1 solutions

  • 0
    @ 2023-5-23 13:38:15
    using namespace std;
    int fun(int n){
    	if(n==1)return 1;
    	return fun(n-1)+n;
    }
    int main(){
    	int n;
    	scanf("%d",&n);
    	printf("%d",fun(n));
    	return 0;
    }
    
    • 1

    Information

    ID
    6839
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    10
    Tags
    (None)
    # Submissions
    3
    Accepted
    3
    Uploaded By