|
|
back to boardWhat's the mistake?(Compilation Error)? I am a beginner in C++, but I made it in Pascal for AC. Please help me to find the mistake! #include<iostream.h> int huge c[100001]; void main() {long a[15],n=0,m=0,mm,i,j; do{n++;cin>>a[n];if(a[n]>m)m=a[n];}while(a[n]); n--; c[0]=0; c[1]=1; for(i=2;i<=m;i++){if(i%2==0)c[i]=c[i/2]; else c[i]=c[i/2]+c[i/2+1];} for(i=1;i<=n;i++){mm=0;for(j=1;j<=a[i];j++)if(mm<c[j])mm=c[j];cout<<mm<<endl;} } Re: What's the mistake?(Compilation Error)? Just erase "huge" in follow line: int huge c[100001]; There is no such type on C++. |
|
|