![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 #include <stdio.h>
2 #include <math.h>
3 int find(__int64 n, int* a)
4 {
5 __int64 t= 0,m=n;
6 for ( int i= 2;i<=m/ 2;i++)
7 {
8 if (n%i== 0)
9 {
10 a[++t]=i;
11 n/=i;
12 }
13 while (n%i== 0) n/=i;
14 if (n== 1) break;
15 }
16 return t;
17 }
18 int main()
19 {
20 int i,l,a[ 1000];
21 __int64 n;
22 while (scanf( " %I64d ",&n)!=EOF)
23 {
24 l=find(n,a);
25 for (i= 1;i<=l;i++)
26 printf( " %2d\n ",a[i]);
27 }
28 return 0;
29
2 #include <math.h>
3 int find(__int64 n, int* a)
4 {
5 __int64 t= 0,m=n;
6 for ( int i= 2;i<=m/ 2;i++)
7 {
8 if (n%i== 0)
9 {
10 a[++t]=i;
11 n/=i;
12 }
13 while (n%i== 0) n/=i;
14 if (n== 1) break;
15 }
16 return t;
17 }
18 int main()
19 {
20 int i,l,a[ 1000];
21 __int64 n;
22 while (scanf( " %I64d ",&n)!=EOF)
23 {
24 l=find(n,a);
25 for (i= 1;i<=l;i++)
26 printf( " %2d\n ",a[i]);
27 }
28 return 0;
29