#include <bits/stdc++.h>//万能头文件 using namespace std;//命名标准库 int main()//主函数 { int n;//定义 cin>>n;//输入 int temp = 0;//定义一个存储累加的东西 for(int i = 1;i <= n;i++)//这里我选择for循环 { temp += i;//累加中 } cout<<temp<<endl;//输出结果 return 0;//结束 }