Open sq4250 opened 1 year ago
#include<stdio.h>
int nn(int n){int a=0;for(int i=1;i<=n;i++)a+=i;return a;}
int main(){
int n,sum=0;
scanf("%d",&n);
for(int i=1;i<=n;i++)sum+=nn(i);
printf("%d",sum);
return 0;
}
#include<stdio.h>
int main(){
int n,sum1=0,sum2=0;
scanf("%d",&n);
for(int i=1;i<=n;i++){sum1+=i;sum2+=sum1;}
printf("%d\n",sum2);
return 0;
}