Advertisement
Guest User

Untitled

a guest
Feb 1st, 2015
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.13 KB | None | 0 0
  1. public static void main(String[] args) {
  2.         // TODO code application logic here
  3.         Scanner input=new Scanner(System.in);
  4.         Scanner scan=new Scanner(System.in);
  5.         int times=input.nextInt();
  6.         String sentences []=new String[times];
  7.         int t=0;
  8.         int s=0;
  9.                
  10.         for(int x=0;x<times;x++)
  11.         {
  12.             sentences[x]=scan.nextLine();
  13.         }
  14.        
  15.         for(int x=0;x<times;x++)
  16.         {
  17.             for(int y=0;y<sentences[x].length();x++)
  18.             {
  19.                 if(sentences[x].charAt(y)=='t'||sentences[x].charAt(y)=='T')
  20.                 {
  21.                     t++;
  22.                 }
  23.                 else if(sentences[x].charAt(y)=='s'||sentences[x].charAt(y)=='S')
  24.                 {
  25.                     s++;
  26.                 }
  27.                
  28.             }
  29.         }
  30.             if(s>t)
  31.             {
  32.                 System.out.println("French");
  33.             }
  34.             else if(t>s)
  35.             {
  36.                 System.out.println("English");
  37.             }
  38.             else
  39.                 System.out.println("French");
  40.          
  41.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement