Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.44 KB | None | 0 0
  1. import java.io.*;
  2. import java.util.*;
  3.  
  4. public class PC {
  5.     public static void main(String[] args) throws FileNotFoundException {
  6.        
  7.         Scanner io = new Scanner(new File("src/t.txt"));
  8.         int word=0;
  9.         String x ="";
  10.         while(io.hasNext())
  11.         {
  12.             String lo = io.next();
  13.             if(lo.equals("E-N-D"))
  14.                 break;
  15.             if(word<lo.length())
  16.             {
  17.                 word = lo.length();
  18.                 x = lo;
  19.             }
  20.            
  21.         }
  22.         System.out.print(x.toLowerCase());     
  23.  
  24.     }
  25.  
  26.  
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement