Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
44298 | 王shizhao | 求1+2+3+... | C++ | Accepted | 0 MS | 240 KB | 146 | 2024-03-29 17:01:37 |
#include<iostream> using namespace std; int sum(int n){ return(n*(n+1)/2); } int main() { int n; cin>>n; cout<<sum(n); return 0; }