方法一
/* Note:Your choice is C IDE */
#include "stdio.h"
int main(){
long long n,sum;
scanf("%I64d",&n);
sum=(n*(n+1))/2;
printf("%I64d",sum);
return 0;
}
方法二
/* Note:Your choice is C IDE */
#include "stdio.h"
int main()
{
long long x;
scanf("%I64d", &x);
printf("%I64d",(x+1)*x/2);
return 0;
}