#include"stdio.h"intmyf(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;
}