Bunnie0116 @ 2017-08-04 15:24:08
#include<cstdio>
#include<string>
#include<iostream>
int main()
{
int m=1,i;
long s;
scanf("%d",&s);
if (s<0){printf("-");s=-s;}
while(s>0)
{
if(s%10==0){
s=s/10;}
else{
printf("%d",s%10);
s=s/10;}
}
return 0;
}
本地用dev测试完全没有问题,上传后测试说是too many or too file lines ?????????
by Naffygo @ 2017-08-04 15:51:56
如果这个数中间有0的话,比如是100204,你的答案就是421
by xiashuai @ 2017-08-10 20:50:07
#include<bits/stdc++.h>
using namespace std;
long long fz(long long a)
{
long long s=0;
while(a)
{
s=s*10+a%10;
a/=10;
}
return s;
}
int main()
{
long long a;
cin>>a;
cout<<fz(a);
return 0;
}
函数
by Goodenough @ 2017-08-12 17:15:52
#include<iostream>
using namespace std;
int main(){
int a,i=0;
cin>>a;
while(a!=0){
i=i*10+a%10;
a/=10;
}
cout<<i;
return 0;
}