Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // length = the length of the number, you can get it by log function
- int ans = 0;
- for (int i = 0; i < length; ++i) {
- new_digit = ((number / Math.pow(10, i)) % 10 + 8) % 10;
- ans += new_digit * Math.pow(10, i);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement