public class lotto1 { public void prog( String args[] ) { int i,j; double y1,y2,y3,y4,y5,y6,y; y1=0; y2=0; y3=0; y4=0; y5=0; y6=0; i=Integer.parseInt ( args[0]); if (i==5) { System.out.print("Az e heti nyeroszamok: "); for (j=1;j<6;j++){ do y=Math.round(1+89*Math.random()); while (y==y1 || y==y2 || y==y3 || y==y4); if (j==1) y1=y; if (j==2) y2=y; if (j==3) y3=y; if (j==4) y4=y; if (j==5) y5=y; } System.out.println(y1+" "+y2+" "+y3+" "+y4+" "+y5); } else if (i==6){ System.out.print("Az e heti nyeroszamok: "); for (j=1;j<7;j++){ do y=Math.round(1+44*Math.random()); while (y==y1 || y==y2 || y==y3 || y==y4 || y==y5); if (j==1) y1=y; if (j==2) y2=y; if (j==3) y3=y; if (j==4) y4=y; if (j==5) y5=y; if (j==6) y6=y; } System.out.print(y1+" "+y2+" "+y3+" "+y4+" "+y5+" "+y6); } else {System.out.println ("Ilyen lotto nincs is!");} } public static void main( String args[] ) { lotto1 e = new lotto1(); e.prog( args ); } }