Source code for submission s482

f1.cpp

  1. #include <iostream>
  2. #include <string>
  3. #include <cstdlib>
  4.  
  5. using namespace std;
  6.  
  7. int main ()
  8. {
  9. int n, x, y, pocet;
  10. n = x = y = pocet = 0;
  11. string input;
  12.  
  13.  
  14. while(cin >> input)
  15. {
  16. n = atoi(input.c_str()+2);
  17. x = n+1;
  18. if (n == 1)
  19. {
  20. cout << 1 << "\n";
  21. continue;
  22. }
  23. while (true)
  24. {
  25. if((x*n)%(x-n)==0)
  26. {
  27. y = x*n/(x-n);
  28. if (y < x) break;
  29. pocet++;
  30. }
  31. x++;
  32. }
  33. y = 0;
  34. x = 0;
  35. cout << pocet << "\n";
  36. pocet = 0;
  37. }
  38.  
  39.  
  40. return 0;
  41. }
  42.