#include<stdio.h>#include<math.h>int main(){ int a,n,count=1; int sn=0,tn=0; printf("Please input a and n: \n"); scanf("a=%d,n=%d",&a,&n); printf("a=%d,n=%d\n",a,n);do{ tn=a; sn+=tn; tn+=a*pow(10,count); count++;}while(count<=n);printf("a+aa+...=%ld\n",sn);return 0;}
- 2 回答
- 0 关注
- 1138 浏览
添加回答
举报
0/150
提交
取消