Visualizzazione dei risultati da 1 a 10 su 11

Visualizzazione discussione

  1. #9
    SOLVED!!! grazie a Schumy e a Lele

    codice:
    package maggioreminore;
    
    
    import java.io.*;
    import static java.lang.Math.max;
    /**
     *
     * @author filipporezzadore
     */
    public class Maggioreminore {
    
    
        /**
         * @param args the command line arguments
         */
        public static void main(String[] args) throws Exception {
        
            int a;
            int b;
            int c;
            
            
           
            int max = 0 ;
            int min = 0 ;
            
            
            
            
            System.out.println("Ins numbers");
            BufferedReader input = new BufferedReader( new InputStreamReader(System.in));
            
            String line = input.readLine();
            
            a = Integer.parseInt(line);
            
            line = input.readLine();
            b = Integer.parseInt(line);
            
            line = input.readLine();
            c = Integer.parseInt(line);
            
            
           if (b > a)
               max = b;
           
           if (c > max)
               max = c;
                   
           if (b > a)
               min = a;
           
           if (c < min)
               min = c;
           
           System.out.println("Largest of the three numbers is " + max);
            System.out.println("Smallest of the three numbers is " + min);
    
    
           
            
    // TODO code application logic here
        }
        
    }
    Ultima modifica di LeleFT; 13-01-2015 a 15:35 Motivo: Aggiunti i tag CODE

Tag per questa discussione

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.