Guest User

Untitled

a guest
Jan 4th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.19 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. int main()
  4. {
  5. int lastDigit[4] = {2, 4, 8, 6};
  6. long long n;
  7.  
  8. std::cin >> n;
  9. std::cout << lastDigit[(n-1)%4];
  10. //std::cout << ((2 << n-1) & 15);
  11. }
Advertisement
Add Comment
Please, Sign In to add comment