The first line of the input consists of an integer numOfProducts, representing the number of products to be considered in the sales data (N).
The second line consists of N space separated characters - productID₁, productID 2...... productIDN representing the product IDs of the sales of the last N products.
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
int n = in.nextInt();
String[] ids = new String[n];
for (int i = 0; i < n; i++) {
ids[i] = in.next();
}
}
}
Comments
Leave a comment