#include<stdio.h>int main(){ long term=0,sum=0; int a,i,n; printf("Input a,n:"); scanf("%d,%d", &a, &n); for(i=1; i<=n; i++) { term = term * 10 + a; sum += term; } printf("sum=%ld\n",sum); return 0;}
- 3 回答
- 0 关注
- 1245 浏览
添加回答
举报
0/150
提交
取消