牛牛学数列4
牛牛学数列4
http://www.nowcoder.com/questionTerminal/586b114f52034688879342ba45779081
include<stdio.h>
main()
{int n,m,k=0,sum=0;
scanf("%d",&n);
for(m=1;m<=n;m++)
{k+=m;
sum+=k;}
printf("%d",sum);}
牛牛学数列4
http://www.nowcoder.com/questionTerminal/586b114f52034688879342ba45779081
main()
{int n,m,k=0,sum=0;
scanf("%d",&n);
for(m=1;m<=n;m++)
{k+=m;
sum+=k;}
printf("%d",sum);}
相关推荐