View Code of Problem 64

#include <stdio.h>

int main(){
	int n,k,l;
	//输入:3个整数,0<n<=10,k<=100,1<=l 
	while(scanf("%d %d %d", &n, &k, &l)!=EOF){
		if(n==0 && k==0 && l==0) break;
		//处理 
		for(int i=0; i<n-2; i++){
			if(2*k-k/2>l){
				break;
			}else{
				k = 2*k-k/2; 
			}
		}
		//输出:1个整数 
		printf("%d\n", k);
	}
	

}

Double click to view unformatted code.


Back to problem 64