tbf123456 @ 2024-10-15 13:28:38
#include<bits/stdc++.h>
using namespace std;
string a1,a2;
int main(){
cin>>a1;
long long len=a1.length();
if(len==1){
cout<<a1[0];
return 0;
}
for(long long i=0; i<len; i++){
a2[i]=a1[len-i-1];
}
for(long long i=0; i<len; i++){
if(i==0&&a2[i]==0) continue;
cout<<a2[i];
}
return 0;
}
by tbf123456 @ 2024-10-16 20:28:35
玄关
by pbcoding @ 2024-10-21 22:40:40
@tbf123456
不只是
bool flag=1;
for(long long i=0;i<len;i++){
if(flag&&a2[i]==0){
continue;
flag = 0;
}
cout<<a2[i];
}
而且要判断负数