#include<iostream>
#include<vector>
#include<cmath>
#define pb(a) push_back(a)
using namespace std;
int main()
{
long n,i,m;
vector<long>pfactor;
cin>>n;
m=sqrt(n);
for(i=2;i<=m;i++)
{
if(n%i==0)
while(n%i==0)
{
pfactor.pb(i);
n/=i;
}
}
if(n!=1)
pfactor.pb(n);
cout<<"number of factor :"<<pfactor.size()<<endl;
for(i=0;i<pfactor.size();i++)
cout<<pfactor[i]<<" ";
}
#include<vector>
#include<cmath>
#define pb(a) push_back(a)
using namespace std;
int main()
{
long n,i,m;
vector<long>pfactor;
cin>>n;
m=sqrt(n);
for(i=2;i<=m;i++)
{
if(n%i==0)
while(n%i==0)
{
pfactor.pb(i);
n/=i;
}
}
if(n!=1)
pfactor.pb(n);
cout<<"number of factor :"<<pfactor.size()<<endl;
for(i=0;i<pfactor.size();i++)
cout<<pfactor[i]<<" ";
}
কোন মন্তব্য নেই:
একটি মন্তব্য পোস্ট করুন