Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
46005 | Jerry | 求和 | C++ | Accepted | 1 MS | 284 KB | 165 | 2024-04-21 20:42:02 |
#include<iostream> using namespace std; int main(){ int a[10000]={ },n; cin>>n; a[1]=1; for (int i=2;i<=n+1;i++){ a[i]=a[i-1]+i; } cout<<a[n+1]; }