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 codeforces_try;
- /**
- * @param args the command line arguments
- */
- import java.io.BufferedReader;
- import java.io.IOException;
- import java.io.InputStreamReader;
- import java.util.Scanner;
- public class Codeforces_try {
- static void proverka(char [][]mass, int isRow){
- int st_i, st_j;
- int count;
- 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(mass[st_i][st_j] == 'X'){
- count++;
- }
- st_j++;
- }
- if(count == 4){
- isRow = 1;
- System.out.println("YES");
- }
- }
- }
- }
- public static void main(String[] args) throws IOException {
- BufferedReader input = new BufferedReader(new InputStreamReader(System.in));
- char [][]mass = new char[10][];
- for(int i = 0; i < 10; i ++){
- mass[i] = input.readLine().toCharArray();
- }
- char temp;
- int vert = 0, horiz = 0, left_diag = 0, right = 0;
- for(int q = 0; q < 2; q ++){
- if(q == 0){ //vertical
- proverka(mass, horiz);
- }
- if(q == 1){ //horizontal
- for(int i = 0; i < 10; i ++){// reverse
- for(int j = 0; j < 10; j ++){
- if(i <= j){
- temp = mass[i][j];
- mass[i][j] = mass[j][i];
- mass[j][i] = temp;
- }
- }
- }
- /*System.out.println("reverse: ");
- for(int i = 0; i < 10; i ++){
- for(int j = 0; j < 10; j ++){
- System.out.print(mass[i][j] + " ");
- }
- System.out.println();
- }*/
- proverka(mass, vert);
- }
- }
- System.out.println("horiz=" + horiz + " vert=" + vert);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement