2023-07-26 10:27发布
#includestdio.hintmyf(intm){return(1+m)*m>>1;}#includeint total(int n
#include"stdio.h"intmyf(intm){return(1+m)*m>>1;}
#include<stdio.h>int total(int n){int i,s=0; for(i=1;i<=n;i++) s+=i; return s;}int main(){ int n; scanf("%d",&n); printf("%d\n",total(n)); return 0;}
最多设置5个标签!
#include<stdio.h>
int total(int n)
{int i,s=0;
for(i=1;i<=n;i++)
s+=i;
return s;
}
int main()
{
int n;
scanf("%d",&n);
printf("%d\n",total(n));
return 0;
}
一周热门 更多>