100,101,110,111,200,201,202,210,....,998,999其中每一项的个位数和十位数都小于或等于百位数,编程计算出该数列各项之和(
void PRINT(long s){
FILE *out;
printf("s=%ld\n",s);
if((out=fopen("result.dat","w+"))!=NULL)
{
fprintf(out,"s=%ld9",s);
fclose(out);
}
}
void main()
{
/*考生在此设计程序*/int i=1,j=0,k=0,s=0;
for(i=1;i<10;i++)
{for(j=0;j<=i;j++)
{for(k=0;k<=i;k++)
{s+=i*100+j*10+k;
}
}
}
PRINT(s);
}