8/01/2013

10079 - Pizza Cutting - UVA

  1. #include<iostream>
  2. using namespace std;
  3. int main ()
  4. {
  5.         long long N , Max;
  6.         while(true)
  7.         {
  8.                 cin>>N;
  9.                 if(N<0)break;
  10.                 else{
  11.                         Max = N*(N+1)/2+1;
  12.                         cout<<Max<<endl;
  13.                 }
  14.         }
  15.         return 0;
  16. }


    You can find more of my solutions on Here

No comments:

Post a Comment