0. ÚLOHA

Limit: 10s

package pal0;
import java.io.BufferedInputStream; 
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) { 
        Scanner scanner = new Scanner(new BufferedInputStream(System.in));
 
        int inputInt;
        int max = Integer.MIN_VALUE;
        int length = 0;
        String output = new String();
 
        int count = scanner.nextInt();
        for (int i = 0; i < count; i++) {
            inputInt = scanner.nextInt();
            if ((inputInt > max)) max = inputInt;
        }
 
        int count2 = scanner.nextInt();
        for (int i = 0; i < count2; i++) { 
            inputInt = scanner.nextInt(); 
            if (inputInt > max) {
                ++length; 
                output += inputInt + System.getProperty("line.separator");
            }
        }
        System.out.println(length);
        System.out.print(output);
 
        scanner.close(); 
    }}
courses/a4m33pal/uloha0.txt · Poslední úprava: 2025/01/03 18:28 (upraveno mimo DokuWiki)
Nahoru
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0