题目 :Problem - 1001 (hdu.edu.cn)
#include<bits/stdc++.h>
using namespace std;
int main(){int a,sum=0;while(scanf("%d",&a)!=EOF){sum=0;for(int i=0;i<=a;i++){sum+=i;}cout<<sum<<"\n"<<endl;}return 0;
}
题目 :Problem - 1001 (hdu.edu.cn)
#include<bits/stdc++.h>
using namespace std;
int main(){int a,sum=0;while(scanf("%d",&a)!=EOF){sum=0;for(int i=0;i<=a;i++){sum+=i;}cout<<sum<<"\n"<<endl;}return 0;
}