mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
Create 1792_42170.cpp
From http://codevs.cn/wiki/solution/?problem_id=1792
This commit is contained in:
parent
1c338bb9bd
commit
cf3ca790e9
22
CodeVS/1792_42170.cpp
Normal file
22
CodeVS/1792_42170.cpp
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#include<cstdio>
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
int N,i;
|
||||||
|
scanf("%d",&N);
|
||||||
|
printf("%d=",N);
|
||||||
|
for(i=2;i<=N;i++)
|
||||||
|
{
|
||||||
|
while(N%i==0)
|
||||||
|
{
|
||||||
|
printf("%d",i);
|
||||||
|
N=N/i;
|
||||||
|
if(N<i)
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
printf("*");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(N==i)
|
||||||
|
printf("%d",N);
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user