Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
6066 邓小龙 [在线测评解答教程] 求和 C++ Accepted 0 MS 256 KB 376 2025-01-03 18:26:41

Tests(10/10):


Code:

#include <iostream> #include <cstring> using namespace std; int main() { int n1[50]={},n2[50]={},sum=0,i=1; while(cin>>n1[i]){ if(n1[i]==EOF){ break; } for(int j=1;j<=n1[i];j++){ n2[i]+=j; } i++; } for(int j=1;j<=i-1;j++){ cout<<n2[j]<<endl; } return 0; }