View Code of Problem 91

#include<iostream>
#include<cstdio>

using namespace std;

int main()
{
	int n, k = 2, f = 0;
	scanf("%d", &n);
	printf("%d=", n);
	if(n == 1)
		printf("1");
	else
		while(n >= k)
		{
			if(n % k == 0)
			{
				if(f)
					printf("*");
				else
					f = 1;
				printf("%d", k);
				n /= k;
			}
			else
				k++;
		}
	return 0;
 } 

Double click to view unformatted code.


Back to problem 91