| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 42512 | chenyifei | 求1+2+3+... | C++ | Accepted | 0 MS | 252 KB | 196 | 2024-02-29 21:23:53 |
#include<iostream> using namespace std; int digui(int n) { if(n==1) return 1; return(digui(n-1) + n); } int main() { int a; cin>>a; cout<<digui(a); return 0; }