Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
56959 | zhangweiran | 求和 | C++ | Accepted | 0 MS | 248 KB | 177 | 2024-11-17 17:13:54 |
#include<bits/stdc++.h> using namespace std; int main() { int n; cin>>n; int S=0; int t=0; for(int i=1;i<=n;i++){ t+=i; S+=t; } cout<<S; return 0; }