10-10-16 fix

This commit is contained in:
Orange_Dugongo 2016-10-10 17:11:25 +02:00
parent dcb3dfd369
commit bcc0373eb3
6 changed files with 14 additions and 14 deletions

BIN
src/Concat.class Normal file

Binary file not shown.

BIN
src/Hello.class Normal file

Binary file not shown.

BIN
src/PariDispari.class Normal file

Binary file not shown.

BIN
src/Rettangolo.class Normal file

Binary file not shown.

Binary file not shown.

View File

@ -8,22 +8,22 @@ public class RettangoloDaTastiera{
int i=0, imax=0;
Scanner in = new Scanner(System.in);
System.out.println("Inserisci la x, la y, la larghezza e l'altezza: ");
ret = new Rectangle(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt());
while(ret.getX()!=0 || ret.getY()!=0 || ret.getWidth()!=0 || ret.getHeight()!=0){
i++;
if(retMax==null || ret.getWidth()*ret.getHeight()>retMax.getWidth()*retMax.getHeight()){
retMax=ret;
imax=i;
}
System.out.println("Inserisci la x, la y, la larghezza e l'altezza: ");
ret = new Rectangle(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt());
}
while(ret.getX()!=0 || ret.getY()!=0 || ret.getWidth()!=0 || ret.getHeight()!=0){
i++;
if(retMax==null || ret.getWidth()*ret.getHeight()>retMax.getWidth()*retMax.getHeight()){
retMax=ret;
imax=i;
}
System.out.println("Inserisci la x, la y, la larghezza e l'altezza: ");
ret = new Rectangle(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt());
}
if(retMax==null)
System.out.println("IMPOSSIBILE ESEGURE L'OPERAZIONE.\nSono stati inseriti zero rettangoli");
else
System.out.println("Il "+imax+"° ha l'area massima");
if(retMax==null)
System.out.println("IMPOSSIBILE ESEGURE L'OPERAZIONE.\nSono stati inseriti zero rettangoli");
else
System.out.println("Il "+imax+"° ha l'area massima");
}
}