View Code of Problem 91

#include<bits/stdc++.h>
using namespace std;
 
int main(){
	int s,j=0;
	cin>>s;
	if(s==1) printf("1=1");
	for(int i = 2; i <= s;i++){
		while(s%i == 0){
			j++;
			if(j == 1) printf("%d=%d",s,i);
			else printf("*%d",i);
			s = s / i;
		}	
	}
}

Double click to view unformatted code.


Back to problem 91