题解 | #数位dp?#
数位dp?
https://ac.nowcoder.com/acm/contest/66877/A
using namespace std;
int main(){
int n;
int count = 0;
int first_bit = 0;
int judge = 0;
cin>>n;
int tep1 = n;
while (tep1>0){ //取它是几位数
first_bit++;
tep1 /=10;
}
tep1 = n;
for(int i=0;i<first_bit;i++){ //删除最后一位奇数
if(tep1%2!=0){
count++;
} else {
break;
}
tep1 /=10;
}
tep1 = n;
for(int i=0;i<first_bit-1;i++){ //取第一位数
tep1 /=10;
}
judge = tep1;
if(judge==0){
count++;
}
if(judge!=0&&n%2==0){ //判断
cout<<"0";
}
else{
cout<<count;
}
return 0;
}