Skufler

5 Задача

Jan 27th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.20 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4. int main() {
  5. int n;
  6. cin >> n;
  7. for (int i = 2; n != 1; i++) {
  8.  
  9. if (n % i == 0) {
  10. cout << i << " ";
  11. n = n / i;
  12. i = 1;
  13. }
  14. }
  15. return 0;
  16. }
Add Comment
Please, Sign In to add comment