int maximum69Number (int num){
int res=1;
int temp=num;
int max=0;
while(temp){
if(temp%10==6) max = res;
temp/=10;
res*=10;
}
if(max==0)return num;
return num-max*6+max*9;
}
LeetCode打卡44
最新推荐文章于 2022-11-09 18:15:12 发布