#include <iostream>
using namespace std;
int main() {
    cout << "Podaj liczbę do rozłozenia na czynniki pierwsze : " << endl;
    int n;
    cin>>n;
                   cout << "Liczbę " <<n<< " można rozłozyć na: " ;
    for (int i=2;i<=n;i++)
        while (n%i==0)
            {cout << "  " <<i;
            n=n/i;}
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: