daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Nov 9th, 2018 88 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
  1. import java.util.*;
  2.  
  3. class Main
  4. {
  5.     public static void main(String[] args)
  6.     {
  7.       Scanner input = new Scanner(System.in);
  8.         String[] words = new String[5];
  9.         for(int i = 0; i < 5;  i++) {
  10.          
  11.           words[i] = input.nextLine();
  12.          
  13.         }
  14.        
  15.         //write your code below
  16.        
  17.        
  18.        
  19.        
  20.         String large = words[0];
  21.         for(int i = 0; i <words.length; i++) {
  22.             if(large.length() < words[i].length()) {
  23.                 large = words[i];
  24.             }
  25.         }
  26.         System.out.println(large);
  27.        
  28.        
  29.        
  30.        
  31.    
  32.        
  33.     }
  34.  
  35. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top