Nathan Coulas

CCC '16 J1 - Tournament Selection

ccc16j1 JAVA8 06 Nov, 2019 0.949s 3 points

Source Code

import java.io.*;
import java.util.*;

public class Main {
    public static void main(String[] args) {
         Scanner in = new Scanner(System.in);
        int counter = 0;
        
        for(int i = 0; i < 6; i++){
          if(in.next().equals("W")){
                counter++;
            }  
        }

        if(counter == 0){
            System.out.println("-1");
        } else if(counter == 5 || counter == 6){
            System.out.println("1");
        }else if(counter == 3 || counter == 4){
            System.out.println("2");
        }else if(counter == 1 || counter == 2){
            System.out.println("3");
        }

    }
}