Wednesday, November 16, 2016

(devskills)Not Easy But Not Hard .cPP

/*                                       CODEMAN
                                      Arif Khan Nihar
                              Problem - Not Easy But Not Hard

                                   */

#include<bits/stdc++.h>
using namespace std;
int main()
{
       int n;
    long long int k,ans;
    cin >> n;
    while( n-- ) {
            ans = 0;
            cin >> k;
       ans =  ( k* ( k + 1 )) / 2;
       cout << ans << endl ;

    }
    return 0;
}

No comments: