Advertisement
Guest User

Untitled

a guest
Jun 28th, 2016
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.22 KB | None | 0 0
  1. // length = the length of the number, you can get it by log function
  2. int ans = 0;
  3. for (int i = 0; i < length; ++i) {
  4. new_digit = ((number / Math.pow(10, i)) % 10 + 8) % 10;
  5. ans += new_digit * Math.pow(10, i);
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement