Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- import java.io.*;
- import java.math.*;
- class Solution {
- public static void main(String args[]) {
- Scanner in = new Scanner(System.in);
- int L = in.nextInt();
- in.nextLine();
- int H = in.nextInt();
- in.nextLine();
- String T = in.nextLine();
- T.toUpperCase();
- char[] nizSlova = T.toCharArray();
- int rb;
- String finalrow = "";
- char[] alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ?".toCharArray();
- for (int i = 0; i < H; i++) {
- String ROW = in.nextLine();
- for( int j=0; j<nizSlova.length; j++){
- for(int k=0; k<alphabet.length; k++){
- if(alphabet[k]==nizSlova[j]){
- finalrow=ROW.substring((k)*L,(k+1)*L);
- }
- }
- }
- System.out.println(finalrow);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement