0_0_29352749_16979.c:1:652: fatal error: iostream: No such file or directory
#include <iostream>#include <algorithm>#include <cstdio>#include <cstring>#include <cmath> int main(){ char n[110]; int sum[110],maxx=0; memset(sum,0,sizeof(sum)); while(~scanf("%s",n)) { if(strcmp(n,"0")==0) break; int len=strlen(n); int j=0; for(int i=len-1;i>=0;i--) { sum[j]+=n[i]-'0'; sum[j+1]+=sum[j]/10; sum[j]=sum[j]%10; j++; } if(sum[j]!=0) maxx=j;//进位不一定为0 else if(maxx<j-1) maxx=j-1; } for(int i=maxx;i>=0;i--) { printf("%d",sum[i]); } printf("\n"); return 0; }
^
compilation terminated.
|