Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class SmallerGreaterOrEqual {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = scanner.nextInt();
- String numString = "";
- int base = 0;
- for (int i = 0; i < n; i++) {
- int a = scanner.nextInt(); // reading the input values entered with spaces on one line
- if (i == 0) {
- numString = numString + String.valueOf(a);
- base = a;
- } else {
- if (a < base) {
- numString = numString + ">" + String.valueOf(a);
- }
- if (a > base) {
- numString = numString + "<" + String.valueOf(a);
- }
- if (a == base) {
- numString = numString + "=" + String.valueOf(a);
- }
- }
- }
- System.out.print(numString);
Advertisement
Add Comment
Please, Sign In to add comment