Answered step by step
Verified Expert Solution
Link Copied!

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 #include #include using namespace std;

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Slimming down of HR departments.

Answered: 1 week ago

Question

Discuss the key ambient conditions and their effects on customers.

Answered: 1 week ago

Question

Understand the roles of signs, symbols, and artifacts.

Answered: 1 week ago