为什么要加换行?
查看原帖
为什么要加换行?
1379298
陈小希2013楼主2024/11/30 12:15
#include<iostream>
#include<cmath>
using namespace std;

int main() 
{
	long long t, x, y;
	cin >> t;
	for (int i = 1; i <= t; i++) 
	{
		cin >> x >> y;
		int num = 1;
		while (x != 0 && y != 0) 
		{
			if (num % 2 == 1) 
			{
				if (x < y) 
				{
					x++;
				}
				else 
				{
					x /= 2;
				}
			}
			else 
			{
				if (y < x) 
				{
					y++;
				}
				else 
				{
					y /= 2;
				}
			}
			num++;
		}
		cout << x << " " << y;
	}
    return 0;
}
2024/11/30 12:15
加载中...