Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int n;
- cin >> n;
- int i = 2; // чтобы не выводило 1
- while(i <= n)
- {
- if(n % i == 0)
- {
- cout << i << endl;
- n /= i;
- }
- else i++;
- }
- return 0;
- }
- //Источник: http://www.programmersforum.ru/showpost.php?p=696588&postcount=7
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement