View Code of Problem 64

#include<stdio.h>
#include<string.h>
#include <math.h>
int main()
{
    int a, b, c,sum,temp;
    while (scanf("%d %d %d",&a,&b,&c)!=EOF)
    {
        if (a==0&&b==0&&c==0)
        {
            break;
        }
        for (int i=1;i<a-1;i++)
        {
            temp = b - b / 2 + b;
            if(temp<c)
            {
                b = b - b / 2 + b;
            }
        }
        printf("%d\n",b);
    }
     
}

Double click to view unformatted code.


Back to problem 64