我去我以为这是道高端数论题。。没想到暴力枚举就能过,真是高看它了。。
#include<cstdio>
int main1823()
{
long long n;
while (scanf("%lld", &n), n != -1)
{
for (long long i = 2; i * i <= n; i++)
if (n % i == 0)
{
printf("%lld\n", i);
n /= i;
i = 1;
}
printf("%lld\n\n", n);
}
return 0;
}