Source code for submission s754

Mosquito.java

  1. import java.io.BufferedReader;
  2. import java.io.IOException;
  3. import java.io.InputStreamReader;
  4. import java.util.Scanner;
  5.  
  6. public class Mosquito {
  7.  
  8. public static void main(String[] args) throws IOException {
  9.  
  10. int M;
  11. int P;
  12. int L;
  13. int E;
  14. int R;
  15. int S;
  16. int N;
  17. int tyden = 0;
  18.  
  19. while (true) {
  20. String radek = br.readLine();
  21. Scanner sc = new Scanner(radek);
  22.  
  23. if (radek.equals(""))
  24. break;
  25.  
  26. M = sc.nextInt(); // dospelci
  27. P = sc.nextInt(); // pocetPup
  28. L = sc.nextInt(); // pocetLarev
  29. E = sc.nextInt(); // vejce ktery naklade 1 dospelec
  30. R = sc.nextInt(); // umrtnost larev
  31. S = sc.nextInt(); // umrtnost pup
  32. N = sc.nextInt();
  33.  
  34. for (int i = 0; i < N; i++) {
  35. int pocetVajec = M * E;
  36. M = 0; // umrou dospeli
  37. M = P / S;
  38. P = L / R;
  39. L = pocetVajec;
  40. }
  41.  
  42. System.out.println(M);
  43. }
  44.  
  45. }
  46. }
  47.