Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
48795 | 张予馨 | 求1+2+3+... | C++ | Wrong Answer | 1 MS | 244 KB | 231 | 2024-06-14 16:14:04 |
#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; for(int i=1;i<=a;i++){ cout<<quihe(i)<<endl; } return 0; }