Source code for submission s955

Main.java

  1. //package Mosquito;
  2.  
  3. import java.util.Scanner;
  4.  
  5. /* ----- MOSQUITO MULTIPLICATION ----- */
  6. public class Main {
  7. static Scanner sc = new Scanner(System.in);
  8. public static void main(String[] args) {
  9. int M, P, L, E, R, S, N;
  10. int i, eggs;
  11. while(sc.hasNext()){
  12.  
  13. M = sc.nextInt(); //moskyti
  14. P = sc.nextInt(); //kokony
  15. L = sc.nextInt(); //larvy
  16. E = sc.nextInt(); //vejce
  17. R = sc.nextInt(); //preziti larev
  18. S = sc.nextInt(); //preziti kokonu
  19. N = sc.nextInt(); //pocet tydnu
  20. sc.nextLine();
  21.  
  22. for(i = 0; i < N; i++){
  23. eggs = M*E;
  24. M = P/S;
  25. P = L/R;
  26. L = eggs;
  27. }
  28. System.out.println(M);
  29. }
  30. }
  31.  
  32. }
  33.