落阳爱编程 @ 2019-08-06 08:42:00
using namespace std;
int main()
{
int n;
cin>>n;
int ans=0;
if(n==0)
cout<<0;
else if(n<0)
{
n=n*(-1);
while(n)
{
ans*=10;
ans+=n%10;
n/=10;
}
cout<<"-"<<ans;
}
else
{
while(n)
{
ans*=10;
ans+=n%10;
n/=10;
}
cout<<ans;
}
return 0;
}
by pzc2004 @ 2019-08-06 08:42:50
你似乎没有吧``` cpp换行
by pomelo_nene @ 2019-08-06 08:43:23
%%%%
by pomelo_nene @ 2019-08-06 08:43:48
所以题解区是没了吗
by 落阳爱编程 @ 2019-08-06 08:45:58
by CreeperLordVader @ 2019-08-06 08:58:21
1.希望更丰富的展现?使用Markdown
2.这种东西不发题解区发到讨论区干啥
by JamesMessi @ 2019-08-21 11:15:24
#include<bits/stdc++.h>
using namespace std;
int a[1000];
int dao(int n){
int s=0;
while (n!=0){
s=s*10+n%10;
n=n/10;
}
return s;
}
int main(){
int n;
cin>>n;
cout<<dao(n);
return 0;
}
//函数
by ldto @ 2019-10-11 13:17:37
嗯
by ldto @ 2019-10-11 13:17:42
using namespace std; int main () { int t=0,m,a; cin>>m; while(m!=0) { a=m%10; t=t*10+a; m=m/10; } cout<<t<<endl; }
by ldto @ 2019-10-11 13:17:59
完美结束