一、题目分析
完成此题有多种方法,这里提供一个简单的代码
二、程序代码
#include<bits/stdc++.h>
using namespace std;
int s=0;
int main(){
int x;
cin>>x;
while(x!=0){
s=s*10+x%10;
x/=10;
}
cout<<s;
return 0;
}
完成此题有多种方法,这里提供一个简单的代码
#include<bits/stdc++.h>
using namespace std;
int s=0;
int main(){
int x;
cin>>x;
while(x!=0){
s=s*10+x%10;
x/=10;
}
cout<<s;
return 0;
}