Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import static java.lang.String.format;
- public class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int N = Integer.parseInt(scanner.nextLine());
- int b = 0;
- StringBuilder result = new StringBuilder();
- for (int i = 0; i < N; i++) {
- int a = Integer.parseInt(scanner.nextLine());
- if (i == 0) {
- result.append(format("%d", a));
- b = a;
- } else {
- if (a > b) {
- result.append(format("<%d", a));
- b = a;
- } else if (a == b) {
- result.append(format("=%d", a));
- } else {
- result.append(format(">%d", a));
- b = a;
- }
- }
- }
- System.out.println(result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment