晨光考试必备 @ 2016-08-24 15:51:05
#include<iostream>
#include<cstring>
using namespace std;
int main(){
char s[15];
gets(s);
for(int i=strlen(s);i>0;i--)
if(s[i]=='0'&&s[i+1]=='\0') s[i]='\0';
if(s[0]=='-'){
cout<<"-";
for(int i=strlen(s)-1;i>=1;i--) cout<<s[i];
}
else{
for(int i=strlen(s)-1;i>=0;i--)
cout<<s[i];
}
return 0;
}
by nizihang @ 2016-08-24 18:40:20
调用cstdio库