Pabon_SEC

Pizza cutting

Sep 3rd, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.22 KB | None | 0 0
  1. #include<stdio.h>
  2. int main()
  3. {
  4.     long long int n,a,b;
  5.     while(scanf("%lld",&n)!=EOF)
  6.     {
  7.         if(n<0)
  8.         break;
  9.         a=n*(n+1);
  10.         b=(a/2)+1;
  11.         printf("%lld\n",b);
  12.     }
  13.     return 0;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment