当前位置:网站首页>Calculation s=1+12+123+1234+12345 C language

Calculation s=1+12+123+1234+12345 C language

2022-07-07 08:53:00 Please Sit Down

#define N 5
#include <stdio.h>
int main(){
    int t = 0,  s = 0 , i;
    for (i = 1; i <= N; i++)    {
        t = i + t * 10 ;
        s += t;
    }
    printf("s=%d\n", s);
    return 0;
}
原网站

版权声明
本文为[Please Sit Down]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130629582137.html