个人解题思路
#include <stdio.h>
int main()
{
int n;
while(scanf("%d", &n) != EOF)
{
printf("%d\n",(1 + n) * n / 2);
}
}
个人解题思路
#include <stdio.h>
int main()
{
int n;
while(scanf("%d", &n) != EOF)
{
printf("%d\n",(1 + n) * n / 2);
}
}