Source code for submission s478

fl.cpp

  1. #include <iostream>
  2. #include <cctype>
  3. #include <cmath>
  4. #include <complex>
  5. #include <cstdio>
  6. #include <string>
  7. #include <list>
  8. #include <map>
  9. #include <queue>
  10. #include <set>
  11. #include <sstream>
  12. #include <stack>
  13. #include <utility>
  14. #include <vector>
  15.  
  16. using namespace std;
  17.  
  18. #define DEBUG(x) cout << ">>> " #x << " : " << x << endl;
  19.  
  20. int main() {
  21.  
  22. int AAA,n;
  23. while(scanf("%d/%d",&AAA,&n)==2)
  24. {
  25. int res=0;
  26. for(double x=1;x<=2*n;++x)
  27. {
  28. double y=n*x/(x-n);
  29. int tem=(int)y;
  30. double y1=(double) tem;
  31. if(y>=x && y1 == y)
  32. ++res;
  33. }
  34.  
  35. printf("%d\n",res);
  36.  
  37. }
  38.  
  39. return 0;
  40. }
  41.