题解 CF791A 【Bear and Big Brother】

QWQ,萌新的写法

超暴力

首先输入a,b,开始循环

个人喜欢一边更改a,b的值一边循环

循环的时候,累加t++

代码如下(曾经我也是P党……但我违心地写了C++……):

#include<bits/stdc++.h> 
using namespace std;
int main()
{
    int n,m;
    int t=0;
    cin>>n>>m;
    while(n<=m)
    {
        n*=3;
        m*=2;
        t++;
    }
    cout<<t;
    return 0;
}

管理大大求过,看在初一新生边做作业边发题解的份上,给过了吧QwQ~

猜你喜欢

转载自www.cnblogs.com/oierscw/p/12542301.html