Go to diff to previous submission
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.Scanner; public class Mosquito { int M; int P; int L; int E; int R; int S; int N; int tyden = 0; while (true) { if (radek == null) { //System.out.println("RADEK JE NULL."); break; } Scanner sc = new Scanner(radek); M = sc.nextInt(); // dospelci P = sc.nextInt(); // pocetPup L = sc.nextInt(); // pocetLarev E = sc.nextInt(); // vejce ktery naklade 1 dospelec R = sc.nextInt(); // umrtnost larev S = sc.nextInt(); // umrtnost pup N = sc.nextInt(); for (int i = 0; i < N; i++) { int pocetVajec = M * E; M = 0; // umrou dospeli M = P / S; P = L / R; L = pocetVajec; } } } }
--- c4.s754.cteam118.mosquito.java.0.Mosquito.java +++ c4.s794.cteam118.mosquito.java.0.Mosquito.java @@ -20,8 +20,13 @@ while (true) { String radek = br.readLine(); + + if (radek == null) { + //System.out.println("RADEK JE NULL."); + break; + } + Scanner sc = new Scanner(radek); - if (radek.equals("")) - break; + M = sc.nextInt(); // dospelci