Advertisement
Guest User

Kaspichan_2

a guest
Apr 16th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. import java.util.*;
  2.  
  3. public class Main {
  4.  
  5. public static void main(String[] args) {
  6. Scanner in = new Scanner(System.in);
  7. String type = in.next("\\d{1,21}");
  8. Long n = Long.parseUnsignedLong(type);
  9. List<String> digits = new ArrayList<>();
  10. for (char i = 'A'; i <= 'Z'; i++) {
  11. digits.add(String.valueOf(i));
  12. }
  13. for (char i = 'a'; i <= 'i'; i++) {
  14. for (char j = 'A'; j <= 'Z'; j++) {
  15. digits.add(String.valueOf(i)+String.valueOf(j));
  16. }
  17. }
  18. String result = "";
  19. if (n==0) {
  20. System.out.printf("A");
  21. }
  22. while (n != 0)
  23. {
  24. result = digits.get((int) (n % 256)) + result;
  25. n = n /256;
  26. }
  27. System.out.printf("%s%n", result);
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement