Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Homework_Loop;
- import java.util.Scanner;
- public class P04_Smaller_greater_or_equal {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- // Write the INPUT on the same line. Example: 3 2 5 1.
- int N = Integer.parseInt(scanner.next());
- int a = Integer.MIN_VALUE;
- for (int i = 1; i <= N; i++) {
- int num = Integer.parseInt(scanner.next());
- if (i == 1) {
- System.out.print(num);
- a = num;
- } else if (a < num) {
- System.out.print("<" + num);
- a = num;
- } else if (a > num) {
- System.out.print(">" + num);
- a = num;
- } else {
- System.out.print("=" + num);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement