Go to diff to previous submission
#include <iostream> #include <string> #include <cstdlib> #include <cstdio> using namespace std; int main () { int n, x, y, pocet; n = x = y = pocet = 0; string input; while (cin) { cin >> input; n = atoi(input.c_str()+2); x = n+1; if (n == 1) { cout << 1 << "\n"; continue; } while (true) { if((x*n)%(x-n)==0) { y = x*n/(x-n); if (y < x) break; pocet++; if (y == x) break; } x++; } y = 0; x = 0; cout << pocet << "\n"; pocet = 0; } return 0; }
--- c5.s506.cteam016.fl.cpp.0.f1.cpp +++ c5.s520.cteam016.fl.cpp.0.f1.cpp @@ -29,4 +29,5 @@ if (y < x) break; pocet++; + if (y == x) break; } x++;