Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- #include <string>
- using namespace std;
- int main()
- {
- ifstream cin("input.txt");
- string n;
- cin>>n;
- string rev ="";
- for(int i = n.length()-1; i >=0; i--)
- {
- if (n[i] == '6')
- rev += '9';
- else if (n[i] == '9')
- rev += '6';
- else
- rev += '8';
- }
- cout<<rev;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement