chavdardim1990

Untitled

Jan 29th, 2023
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. import java.util.Scanner;
  2. import static java.lang.String.format;
  3.  
  4. public class Main {
  5. public static void main(String[] args) {
  6. Scanner scanner = new Scanner(System.in);
  7. int N = Integer.parseInt(scanner.nextLine());
  8. int b = 0;
  9. StringBuilder result = new StringBuilder();
  10.  
  11. for (int i = 0; i < N; i++) {
  12. int a = Integer.parseInt(scanner.nextLine());
  13. if (i == 0) {
  14. result.append(format("%d", a));
  15. b = a;
  16. } else {
  17.  
  18. if (a > b) {
  19. result.append(format("<%d", a));
  20. b = a;
  21. } else if (a == b) {
  22. result.append(format("=%d", a));
  23. } else {
  24. result.append(format(">%d", a));
  25. b = a;
  26. }
  27. }
  28. }
  29. System.out.println(result);
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment