Wrong Answer
/in/foo.c: In function 'main': /in/foo.c:6:16: warning: format '%d' expects argument of type 'int *', but argument 2 has type 'long long int *' [-Wformat=] scanf("%I64d", &n); ^ /in/foo.c:8:17: warning: format '%d' expects argument of type 'int', but argument 2 has type 'long long int' [-Wformat=] printf("%I64d", sum); ^
代码
#include <stdio.h>
int main()
{
long long n, sum;
scanf("%I64d", &n);
sum = (n + 1) * n / 2;
printf("%I64d", sum);
return 0;
}