Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Massimoarray {
- public static void main(String[] args) {
- Scanner leggi= new Scanner(System.in);
- int array[];
- array= new int [5];
- int numeroMassimo=0;
- for(int i=0; i<5; i++)
- {
- System.out.print("inserisci i numeri:");
- array[i]= leggi.nextInt();
- }
- for(int i=0; i<5; i++)
- {
- if(numeroMassimo<array[i])
- {
- numeroMassimo=array[i];
- }
- }
- System.out.print(numeroMassimo);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement