#include <iostream>
using namespace std;
int main()
{
int x,i=2;
cout << "Wprowadź liczbę: ";
cin >> x;
while (i <= x)
if (x % i == 0)
cout << i << endl;
x /= i;
i = 2;
}
else
i++;
" Life is not a problem to be solved but a reality to be experienced! "
© Copyright 2013 - 2024 KUDO.TIPS - All rights reserved.
#include <iostream>
using namespace std;
int main()
{
int x,i=2;
cout << "Wprowadź liczbę: ";
cin >> x;
while (i <= x)
{
if (x % i == 0)
{
cout << i << endl;
x /= i;
i = 2;
}
else
{
i++;
}
}
}