/*因子与阶乘*/
#include<stdio.h>
#include<math.h>
#include<iostream>
#include<string>
#include<assert.h>
using namespace std;
#define max 100000000
int time[max];
int a[max];
int b[max];
int T(int n)
{
int total=1;
for (int i = 1; i <= n; i++)
{
total *= i;
}
return total;
}
int main()
{
int sushu = 2;//素数,除1和其本身之外,不会被整除
int number;
int p = 1;//数组下标初始值
while (scanf("%d", &number))
{
memset(time, 0, sizeof(time));
assert(number >= 2 && number <= 100);
//number = T(number);
//cout << number << endl;
int j = 1;//计算number有多少个不同的素数的初始值
for (sushu = 2; sushu <=100; sushu++)//第一循环是找大于等于2的数
{
int found = 1;
for (int i = 2; i < sushu; i++)//第二循环是找素数的
{
if (sushu%i == 0 && sushu != 2)
{
found = 0;
break;
}
}
if (found) a[p] = sushu;
p++;
}//找完number可能含有的素数
int Ti = 1;
int x = number;
number = 1;
int total=0;
int temp;
while (Ti <= x)
{
number *= Ti;
for (int i = 1; i < p; i++)
{
if (a[i] == 0) continue;
for (; number != 1;)//第三循环是找可以讲number整除的素数及每种素数的个数
{
if (number%a[i] == 0)
{
number = number / a[i];
time[i]++;//计算每种素数的个数
}
else break;
}
if (number == 1)
{
temp = i;
break;
}
}
Ti++;
if(temp>=total)total = temp;
}
for (int i = 1; i <= total; i++)
{
if (a[i] != 0)
{
printf("%d", time[i]);
if (i < total) cout << " ";
if (i == total) cout << endl;
}
}
}
system("pause");
return 0;
}