Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args){
- Scanner sc = new Scanner(System.in);
- int a = sc.nextInt();
- int b = sc.nextInt();
- String [] [] mas = new String [b][a];
- for(int i = 0; i < b; i++){
- for(int j = 0 ;j < a; j++){
- mas[i][j] = sc.next();
- }
- }
- String [][] mas1 = new String[b][a];
- for(int i = 0; i < b; i++){
- for (int j = 0; j < a; j++){
- mas1[i][j] = sc.next();
- }
- }
- for (int i = 0; i < b; i++){
- for (int j = 0; j < a; j++){
- if(!(mas[i][j].equals(mas1[i][j]))){
- if(!(mas[i][j].equals("*"))){
- System.out.print(mas[i][j] + " ");
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement