Source code for submission s807

Fl.java

  1.  
  2. import java.util.Scanner;
  3.  
  4.  
  5. /**
  6.  *
  7.  * @author cteam023
  8.  */
  9. public class Fl {
  10.  
  11. private static void vypocitej(int n) {
  12. // int count = 0;
  13. // int jm = jmenovatel;
  14. // for(int i = 1; i<=10000; i++) {
  15. // jm+=jmenovatel;
  16. // if(jm%i == 0) {
  17. // count++;
  18. // }
  19. // }
  20. int count = 0;
  21. for (int y = n+1; y <= n*2; y++){
  22. if (n*y % (y-n) == 0){
  23. count++;
  24. }
  25. }
  26.  
  27.  
  28. System.out.println(count);
  29. }
  30.  
  31.  
  32. public static void main(String[] args) {
  33. Scanner sc = new Scanner(System.in);
  34. int jmenovatel;
  35. String radek;
  36. while(sc.hasNextLine()) {
  37. radek = sc.nextLine();
  38. radek = radek.substring(2);
  39. jmenovatel = Integer.parseInt(radek);
  40. vypocitej(jmenovatel);
  41. }
  42. }
  43.  
  44. }
  45.