2+22+222+2222+22222
#include<stdio.h>标签:aa,aaa,五项,int,sum,ret,aaaa From: https://blog.51cto.com/u_15806064/5981207
int main()
{
int a=0;
scanf("%d",&a);
int sum=0;
int i=0;
int ret=0;
for(i=0;i<5;i++)
{
ret=ret*10+a;
sum=sum+ret;
}
printf("%d\n",sum);
return 0;
}
//除了计算前五项外,还可以再定义一个n,i<n即可