Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
97294 | Yah123 | [在线测评解答教程] 求和 | C++ | Accepted | 1 MS | 276 KB | 209 | 2024-11-12 16:54:25 |
#include<iostream> using namespace std; int main(){ int n,i; int total; total = 0; while(cin>>n){ for(i=0;i<=n;i++){ total+=i; } cout << total << endl; total = 0; } return 0; }