Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- using namespace std;
- void rec(int number) {
- if(number == 0) {
- return;
- }
- int last_digit = number % 10;
- if(last_digit == 9) {
- last_digit = 7;
- }
- rec(number / 10);
- cout << last_digit;
- }
- int main()
- {
- int number;
- cin >> number;
- rec(number);
- cout << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement