Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
28606 | 闻航 | [在线测评解答教程] 求和 | C++ | Accepted | 1 MS | 244 KB | 228 | 2023-10-16 09:41:05 |
#include<iostream> using namespace std; int main() { int n,i,sum; while (cin >> n) { for(i=1;i<=n;i++){ sum+=i; } cout<<sum<<endl; sum=0; } return 0; }