Answered step by step
Verified Expert Solution
Question
1 Approved Answer
convert string to int in c++ #include #include #include using namespace std; string pdr(int n){ int cnt=0; int i=0; string out_string; stringstream ss; if(n==0 ||
convert string to int in c++
#include
string pdr(int n){ int cnt=0; int i=0; string out_string; stringstream ss; if(n==0 || n==1){ ss << n; return ss.str(); }
for(i=2;i<=n;i++){ if(n%i == 0 && isPrime(i,i/2)){ while(n%i==0){ if(cnt>0) ss << "*" << i; else ss << i; n=n/i; cnt++; } } }
return ss.str(); }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started