Source Code
#include <iostream>
using namespace std;
 
int main() {
	int h=0,t=0,count = 0;
	bool flag = true;
	string a ="";
	cin>>a;
	h = (int)a[0];
	t = (int)a[2];
	if(!(h>=1&&h<=100&&t>=1&&t<=100)){
		flag = false;
	}
	while((h>=t)&& flag){
	  t= t+t;
	  count++;
	}
	cout<<count;
	return 0;
}
Copy
The Tortoise and the Hare 5hafiq
GNU G++14
2 ms
252 KB
Wrong Answer