A. Locked Calculator
题解
1.如果要使用计算符号,那么一定要按等于号,也就是说,需要激活的按键至少三个
2.只激活 \(1,+,=\) 可以达到任意数
3.比较数的长度和3
code
#include<bits/stdc++.h>
using namespace std;
int main()
{
int t;
cin>>t;
while(t--)
{
int n;
cin>>n;
int ans=0;
int tem=n;
do
{
ans++;
tem/=10;
}while(tem);
cout<<min(3,ans)<<endl;
}
return 0;
}

浙公网安备 33010602011771号