|
|
вернуться в форумwhy is the ""compiling error""? #include <iostream> using namespace std; int main() { bool t; int n,nn; cin>>n; short a[n]; for(int i=0;i<n;i++) { t=true; cin>>nn; if((i-1>=0&&a[i-1]<=nn)||(i==0)) a[i]=nn; else for(int j=0;j<i;j++) { if(a[j]>nn) { for(int jj=i;jj>j;jj--) a[jj]=a[jj-1]; a[j]=nn; t=false; } if(!t)break; } } int c=0; for(int i=0;i<(n/2)+1;i++) c+=a[i]/2+1; cout<<c; } compiling error?? Edited by author 07.10.2007 21:56 Re: why is the ""compiling error""? [code deleted] Edited by moderator 20.11.2019 00:23 Re: why is the ""compiling error""? AC!you must create your array with another way |
|
|