Educational Codeforces Round 80 (Rated for Div. 2)(BYet Another Meme Problem)

(B)Yet Another Meme Problem

 

题目

 

Educational Codeforces Round 80 (Rated for Div. 2)(BYet Another Meme Problem)_第1张图片

 

 

思路:找b中9,99,999,999.。。。比b小的这些个数,然后相乘就行。。。

#include
using namespace std;
int main()
{
    //freopen("text","r",stdin);
    int T;
    scanf("%d",&T);
    while(T--)
    {
        long long a,b;
        cin>>a>>b;
        if(b<9)
            printf("0\n");
        else{
            if(b<99)
                cout<endl;
            else if(b<999)
                cout<2<<endl;
            else if(b<9999)
                cout<3<<endl;
            else if(b<99999)
                cout<4<<endl;
            else if(b<999999)
                cout<5<<endl;
            else if(b<9999999)
                cout<6<<endl;
            else if(b<99999999)
                cout<7<<endl;
            else if(b<999999999)
                cout<8<<endl;
            else
                cout<9<<endl;
        }
 
    }
    return 0;
}

你可能感兴趣的