View Code of Problem 64

#include <stdio.h>
int main()
{
    int n,k,L;
    scanf("%d %d %d",&n,&k,&L);
    if(N==0&&K==0&&L==0)
    {
        break;
    }
    for(int i=2;i<n;++i)
    {
        if(k-k/2+k<L)
        {
            k=k-k/2+k;
        }
    }
    printf("%d\n",k);
}

/*
Main.c: In function 'main':
Main.c:6:8: error: 'N' undeclared (first use in this function)
     if(N==0&&K==0&&L==0)
        ^
Main.c:6:8: note: each undeclared identifier is reported only once for each function it appears in
Main.c:6:14: error: 'K' undeclared (first use in this function)
     if(N==0&&K==0&&L==0)
              ^
Main.c:8:9: error: break statement not within loop or switch
         break;
         ^~~~~
*/

Double click to view unformatted code.


Back to problem 64