Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
30861 | chenyanda | [在线测评解答教程] 求和 | C++ | Accepted | 1 MS | 244 KB | 232 | 2023-11-11 16:14:48 |
#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; }