Thursday, March 17, 2011

10079 - Pizza Cutting


#include<iostream>
#include<cstdio>
#include<conio.h>
using namespace std;
int main()
{
    register long long n,t;
    register long m;
    //freopen("in.txt","r",stdin);
    while(cin>>n&&n>=0)
    {
        t=(n*(n+1))/2+1;
        cout<<t<<"\n";
    }
    getch();
    return 0;
}

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.