#include"stdio.h" main() { int n,a,s=0,s1=0,count=1; printf("请输入a和n的值:\n"); scanf("%d%d",&a,&n); printf("a=%d n=%d \n",a,n); while(count<=n) { s1=s1+a; s=s1+s; a=10*a; ++count; } printf("a+aa+...+aa...a=%d\n",s); }
while(count<=n) { s1=s1+a; s=s1+s; a=10*a; ++count; }