View Code of Problem 91

#include <iostream>
#include <cmath>
using namespace std;

int main() {
	int a,i,k=0;
	cin >>a;
	for(int i=2;i<=a;i++){
		while(a%i==0){
			k++;
			if(k==1)
				cout << a<<"="<<i;
			else
				cout << "*"<<i;
			a=a/i;
		}
		
	}
	 
	return 0;
}

Double click to view unformatted code.


Back to problem 91