Advertisement
yejolga

ol_5_02

Nov 4th, 2019
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.40 KB | None | 0 0
  1. #include <iostream>
  2. #include <fstream>
  3. #include <string>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.     ifstream cin("input.txt");
  10.  
  11.     string n;
  12.     cin>>n;
  13.  
  14.     string rev ="";
  15.     for(int i = n.length()-1; i >=0; i--)
  16.     {
  17.         if (n[i] == '6')
  18.             rev += '9';
  19.         else if (n[i] == '9')
  20.             rev += '6';
  21.         else
  22.             rev += '8';
  23.     }
  24.     cout<<rev;
  25.  
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement