1 solutions

  • 1
    @ 2024-7-17 20:36:51
    #include<bits/stdc++.h>
    
    using namespace std;
    
    long long dg(long n){
    	long long ans = 0;
    	for (int i = 1; i <= n; i++){
    		ans += i;
    	}
    	return ans;
    }
    
    int main(){
    	int n;
    	cin >> n;
    	cout << dg(n);
    	return 0;
    }
    
    • 1

    Information

    ID
    6986
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    1
    Tags
    # Submissions
    1
    Accepted
    1
    Uploaded By