Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
48797 | 张予馨 | 求1+2+3+... | C++ | Accepted | 1 MS | 252 KB | 194 | 2024-06-14 16:17:32 |
#include<bits/stdc++.h> using namespace std; int quihe(int a){ if(a==1) return 1; int sum=quihe(a-1)+a; return sum; } int main() { int a; cin>>a; cout<<quihe(a); return 0; }