Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class readMethodScanner {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int n = Integer.parseInt(scanner.nextLine());
- String read = "";
- String operation = "";
- String message = "";
- String errorCode = "";
- String read5 = "";
- int count = 0;
- while (count <= n) {
- read = scanner.nextLine();
- if (read.equals("error")) {
- read = scanner.nextLine();
- operation = read;
- read = scanner.nextLine();
- message = read;
- read = scanner.nextLine();
- errorCode = read;
- } else if (read.equals("warning")) {
- read = scanner.nextLine();
- operation = read;
- } else if (read.equals("success")) {
- read = scanner.nextLine();
- operation = read;
- read = scanner.nextLine();
- message = read;
- }else if (read.equals("warning")) {
- read = scanner.nextLine();
- operation = read;
- }
- count++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement