View Code of Problem 91

#include<bits/stdc++.h>

using namespace std;
int main(){
	int n;
	cin>>n;
	cout<<n<<"=";
	for(int i = 2;i<n/2;i++){
		while(n!=i){
			if(n%i==0){
				cout<<i<<"*";
				n/=i;
			}else break;
		}
	} 
	cout<<n;
	return 0;
} 

Double click to view unformatted code.


Back to problem 91