The_fisher @ 2023-08-13 13:12:07
本蒟蒻70分
#include <bits/stdc++.h>
using namespace std;
char str[11];
bool un = false;
main() {
gets(str);
if (str[0] == '-') {
un = true;
}
int len = strlen(str);
if (un) {
cout << "-";
}
while (len--) {
if (str[len] == '0' || str[len] == '-') {
continue;
}
cout << str[len];
}
}
by __xux__ @ 2023-08-15 11:59:20
@AlexSong 说了我就只改了中间
by AlexSong @ 2023-08-15 12:00:36
求关
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,temp,ans=0;
cin>>n;
while (n)
{
temp = n%10;
ans = ans*10+temp;
n /= 10;
}
cout<<ans<<endl;
return 0;
}