Skip to content

Commit

Permalink
Create reverse_big_int.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyCoding8 authored Oct 7, 2023
1 parent 3acad09 commit 78e1c74
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Logical Problems/reverse-number/reverse_big_int.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#include<bits/stdc++.h>
using namespace std;

string reverse_number(string s){
reverse(s.begin(),s.end());
for(auto it:s){
if(it<'0'||it>'9') return "Error";
}
return s;
}

int main(){
string s;
cin>>s;
cout<<reverse_number(s)<<endl;
return 0;
}

0 comments on commit 78e1c74

Please sign in to comment.