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++; } x++; } y = 0; x = 0; cout << pocet << "\n"; pocet = 0; } return 0; }
--- c5.s482.cteam016.fl.cpp.0.f1.cpp +++ c5.s506.cteam016.fl.cpp.0.f1.cpp @@ -2,4 +2,5 @@ #include <string> #include <cstdlib> +#include <cstdio> using namespace std; @@ -11,7 +12,7 @@ string input; - - while(cin >> input) + while (cin) { + cin >> input; n = atoi(input.c_str()+2); x = n+1;