publicstaticvoidmain(String[]ARGS){Scannerscanner=newScanner(System.in);intgesucht=3;intcon=0;while(con!=gesucht){con=scanner.nextInt();if(con>gesucht)System.out.println("Zahl zu groß");elseif(con<gesucht)System.out.println("Zahl zu klein");}System.out.println("Richtig! Die gesuchte Zahl war "+gesucht);}
Comments (0)
HTTPSSSH
You can clone a snippet to your computer for local editing.
Learn more.