UVA 10079 - Pizza Cutting

UVA Sep 1, 2020

Problem PDF

Solution:

#include 

int main()
{
    long int n,a;
    while(scanf("%ld", &n)==1)
    {
        if( n>=0 && n<=210000000)
        {
            a= ((n*(n+1))/2)+1;
            printf("%ld\n", a);
        }
        else if(n<0)
        break;
    }
    return 0;
}
https://github.com/Shipu/OnlineJudgeProblemSolutionWithCPlusPlus/tree/master/uva/10079/10079.cpp

Tags

Great! You've successfully subscribed.
Great! Next, complete checkout for full access.
Welcome back! You've successfully signed in.
Success! Your account is fully activated, you now have access to all content.