|
|
back to boardWrong Answer in task 2 Posted by MrRobot 17 Aug 2020 19:53 #include <iostream> #include <vector> #include <algorithm> using namespace std; int main() { int Num = 0, ans = -2; cin >> Num; vector <int> fact; int n = 2; while (Num > 1) { if (n > 9) { ans = -1; break; } while (Num % n == 0) { Num /= n; fact.push_back(n); } n++; } sort(fact.begin(), fact.end()); if (n < 10 & ans != -1) { ans = 0; for (int i = 0; i < fact.size(); i++) { //ans += fact.at(i) * (i*10); cout << fact[i]; } } //cout << ans; } |
|
|