Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package copp_111;
- /**
- * @param args the command line arguments
- */
- import java.util.Scanner;
- public class Copp_111 {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- String [][]mass = new String[10][];
- for(int i = 0; i < 10; i ++){
- mass[i] = sc.nextLine().split(" ");
- }
- StringBuilder [][]massBuilder = new StringBuilder[10][10];
- for(int i = 0; i < 10; i ++){
- for(int j = 0; j < 10; j ++){
- massBuilder[i][j].replace(0, 1, mass[i][j]);
- }
- }
- StringBuilder temp = new StringBuilder();
- int st_i, st_j;
- int count;
- for(int q = 0; q < 2; q ++){
- if(q == 1){ // reverse
- for(int i = 0; i < 10; i ++){
- for(int j = 0; j < 10; j ++){
- temp.replace(0, 1, massBuilder[i][j].toString());
- massBuilder[i][j] = massBuilder[j][i];
- massBuilder[j][i].replace(0, 1, temp.toString());
- }
- }
- for(int i = 0; i < 10; i ++){
- for(int j = 0; j < 10; j ++){
- System.out.print(massBuilder[i][j] + " ");
- }
- System.out.println();
- }
- }
- for(int i = 0; i < 10; i ++){
- st_i = i;
- for(int j = 0; j < 6; j ++){
- st_j = j;
- count = 0;
- for(int k = 0; k < 5; k ++){
- if(massBuilder[st_i][st_j].toString().equals("X")){
- count++;
- }
- st_j++;
- }
- if(count == 4){
- System.out.println("YES");
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement