C-study/04/1/1.c

18 lines
171 B
C
Raw Normal View History

2021-11-04 16:59:48 +00:00
#include<stdio.h>
#include<math.h>
int main(){
int n,a=0,sum=0;
scanf("%d",&n);
for(int i=1;i<=n;i++){
a=a*10+i;
sum+=a;
}
printf("%d",sum);
return 0;
}