huzihang666 @ 2024-05-23 19:32:05
求大佬帮忙看看,就七十分
#include <bits/stdc++.h>
using namespace std;
int main(){
string a;
cin>>a;
if(a[0]=='-'){
cout<<"-";
for(long long i=a.size()-1;i>0;i--){
if(a[i]=='0') continue;
else cout<<a[i];
}
}else{
for(long long i=a.size()-1;i>=0;i--){
if(a[i]=='0') continue;
else cout<<a[i];
}
}
return 0;
}
by ZYLZPP @ 2024-05-23 19:44:44
@baby2013
if(a[i]=='0') continue;
这会过滤掉所有的0
你测个102就知道了
by huzihang666 @ 2024-05-23 19:48:41
@ZYLZPP 原来如此,谢谢大佬