Eddy's research I

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/m13526413031/article/details/79017681

Problem Description

Eddy's interest is very extensive, recently he is interested in primenumber. Eddy discover the all number owned can be divided into the multiply ofprime number, but he can't write program, so Eddy has to ask intelligent you tohelp him, he asks you to write a program which can do the number to dividedinto the multiply of prime number factor .

Input

The input will contain anumber 1 < x<= 65535 per line representing the number of elements of theset.

Output

You have to print a linein the output for each entry with the answer to the previous question.

Sample Input

11

9412

Sample Output

11

扫描二维码关注公众号,回复: 4579546 查看本文章

2*2*13*181

代码如下:

#include<stdio.h>

int main()

{

    int m;

    while(scanf("%d",&m)!=EOF)

    {

        for(inti=2;i<=m;i++)

        {

            while(m%i==0)

            {

                if(m/i==1)

                printf("%d\n",i);

                else

                printf("%d*",i);

                m=m/i;

            }

        }

    }

}



猜你喜欢

转载自blog.csdn.net/m13526413031/article/details/79017681