#include<stdio.h> #include<string.h> #include<math.h> #include<algorithm> using namespace std; int main() { int t; while(scanf("%d",&t)!=EOF) { int sum=(t+1)*t/2; printf("%d\n",sum); } }
Double click to view unformatted code.