madhawaseeeee

mysubmax

Sep 17th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1.  
  2. class MySubMax extends MyAbstractProcess {
  3.    
  4.     public static void main(String[] args) {
  5.        
  6.         new MySubMax().printValue();
  7.     }
  8.  
  9.     public int action() {
  10.  
  11.         String x[] = readValues();
  12.  
  13.         int max = Integer.parseInt(x[0]);
  14.  
  15.         for (int i = 0; i < x.length; i++) {
  16.  
  17.             int currentNumber = Integer.parseInt(x[i]);
  18.             if (max < currentNumber) {
  19.  
  20.                 max = currentNumber;
  21.             }
  22.  
  23.         }
  24.         return  max;
  25.  
  26.     }
  27.  
  28. }
Advertisement
Add Comment
Please, Sign In to add comment