Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
---|---|---|---|---|---|---|---|---|
92364 | 123456789q | [在线测评解答教程] 求和 | C++ | Accepted | 2 MS | 272 KB | 182 | 2024-10-01 10:26:26 |
#include <bits/stdc++.h> using namespace std; int main(){ int n,a=0; while(cin>>n){ for(int i=1;i<=n;i++){ a=a+i; } cout<<a<<endl; a=0; } return 0; }