View Code of Problem 64

#include<stdio.h>
int main()
{
	int n,m,l,count;//站台 初始 限乘
	while(scanf("%d%d%d",&n,&m,&l)==3)
	{
		if(n==0&&m==0&&l==0)
              break;
		int i;
		count=m;
		for(i=2;i<n;i++)
		{  m=count;
		   m=m-m/2+m;
			if(m<=l)
				  count=m; 
			else
				//count=m+m/2-m;
				break;
			    
		}		
       printf("%d\n",count);
	 } 
	 return 0;
}

Double click to view unformatted code.


Back to problem 64