Source code for submission s609

fl.java

  1. import java.util.Scanner;
  2.  
  3.  
  4. public class fl {
  5. private int n;
  6. public fl(){
  7. Scanner s = new Scanner(System.in);
  8. String riadok;
  9. while(s.hasNext()){
  10. riadok = s.next();
  11. n = Integer.parseInt(riadok.substring(2));
  12. ries();
  13. }
  14.  
  15. s.close();
  16. }
  17.  
  18. private void ries() {
  19. int pocet = 0;
  20. for (int x = n+1; x < 2*n+1; x++) {
  21. double y = (n*x)/(x-n);
  22. if ((n*x) % (x-n) == 0 ){
  23. pocet++;
  24. }
  25. }
  26. System.out.println(pocet);
  27. }
  28.  
  29. public static void main(String[] args) {
  30. fl f = new fl();
  31.  
  32. }
  33.  
  34. }
  35.