10 solutions
-
3
#include<bits/stdc++.h> using namespace std; long long n; int f(long long x,long long &ans){//递归 if(x==0) return ans/10;//除10是因为最后多一个0 ans+=x%10; ans*=10; return f(x/10,ans);//继续从x/10开始 }//ans可以不取地址 int main(){ cin>>n; long long ans=0; long long s=f(n,ans); if(n%10==0) cout<<0; cout<<s<<endl; return 0;//不必多言 }
想不到骚话了
-
0
不要抄哦
#include<bits/stdc++.h> using namespace std; char n[114514]; int m[114514]; int main() { int x = 1, num = 0; while(cin >> n[x])//输入 { m[x] = n[x] -'0'; x++; num++; } for(int i = num; i > 0; i--) { cout << m[i]; } return 0; } //#include<bits/stdc++.h> //using namespace std; //int n; //int main() //{ // cin>>n; // int num=0;//计数 // while(n)//123 // { // num*=10;//进位 // num+=n%10;//123%10=3 //12%10=2 //1%10=1 // n/=10;//123/10=12 //12/10=1 //1/10=0 // } // int s=n%10;//123%10=3 // if(s==0)//判断个位为0 // { // cout<<0; // } // cout<<num; // return 0; //}
- 1
Information
- ID
- 646
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 5
- Tags
- # Submissions
- 116
- Accepted
- 49
- Uploaded By