Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
16984 | wanyichen | 求和 | C++ | Accepted | 0 MS | 244 KB | 163 | 2023-05-09 19:41:38 |
#include<bits/stdc++.h> using namespace std; int main(){ int a,sum=0; cin>>a; for(int i=1;i<=a;i++){ sum=sum+i; } cout<<sum<<endl; return 0; }