#include <stdio.h> #include<math.h> int main () { int a=2,n=3,sum1=0,sum2=0,i; //while (scanf("%d %d",&a,&n)!=EOF) //{ for (i = 0; i <n; i++) { sum1=sum1*10+a; sum2=sum2+sum1; } printf("%d\n", sum2); //sum1=sum2=0; //} return 0; }
#include <stdio.h> #include<math.h> int main () { int a=2,n=3,sum1=0,sum2=0,i; //while (scanf("%d %d",&a,&n)!=EOF) //{ for (i = 0; i <n; i++) { sum1=sum1*10+a; sum2=sum2+sum1; } printf("%d\n", sum2); //sum1=sum2=0; //} return 0; }
转载于:https://www.cnblogs.com/guojiusong/p/8029279.html