Go to diff to previous submission
#include <iostream> #include <string> #include <cstdlib> #include <cstdio> #include <vector> using namespace std; int main () { unsigned long n, x, y, pocet; n = x = y = pocet = 0; string input; vector<unsigned long> pouzite; bool nasel = false; while (cin) { cin >> input; if (input.empty()) break; n = atoi(input.c_str()+2); x = n+1; if (n == 0) { cout << 0 << "\n"; continue; } if (n == 1) { cout << 1 << "\n"; continue; } while (float((x*n)%(x-n)) < n+1) { if((x*n)%(x-n)==0) { y = x*n/(x-n); //if (y < x) break; nasel = false; for (vector<unsigned long>::iterator i = pouzite.begin(); i != pouzite.end(); i++) { if ((*i) == y) { nasel = true; break; } } if (!nasel) { pouzite.push_back(x); pocet++; } //pocet++; //if (y == x) break; } x++; } y = 0; x = 0; cout << pocet << "\n"; pocet = 0; pouzite.clear(); } cout << "\n"; return 0; }
--- c5.s823.cteam016.fl.cpp.0.fl.cpp +++ c5.s826.cteam016.fl.cpp.0.fl.cpp @@ -63,4 +63,5 @@ pouzite.clear(); } + cout << "\n"; return 0; }