那个题

#include<stdio.h>
#include<math.h>

int main(void)
{
int T,A,B,a,b,con,count;
scanf("%d",&T);
while(T–)
{
scanf("%d%d",&A,&B);
count=0;con=9;

        while(con<=B)
        {count++;
        con=con*10+9;

        }

    printf("%d\n",count*A);
}

}

#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
int t,a,b;
scanf("%d",&t);
while(t–)
{
scanf("%d%d",&a,&b);
ll num=0,tmp=9;
while(tmp<=b)
num++,tmp=tmp10+9;
printf("%I64d\n",(ll)num
a);
}

return 0;

}

发布了19 篇原创文章 · 获赞 0 · 访问量 125

猜你喜欢

转载自blog.csdn.net/weixin_45810623/article/details/104022946
今日推荐