mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
31 lines
575 B
C++
31 lines
575 B
C++
|
#include<iostream>
|
||
|
using namespace std;
|
||
|
int main()
|
||
|
{
|
||
|
int n,num,p=0,i,m,j=1;
|
||
|
while(cin>>n&&n>1)
|
||
|
{
|
||
|
if(p)
|
||
|
cout<<endl;
|
||
|
cout<<"Case "<<j++<<"."<<endl;
|
||
|
num=0;m=n;
|
||
|
for(i=2;i<=m;i++)
|
||
|
{
|
||
|
if(n%i==0)
|
||
|
{
|
||
|
num++;
|
||
|
n=n/i;
|
||
|
i=i-1;
|
||
|
}
|
||
|
else if(num!=0)
|
||
|
{
|
||
|
cout<<i<<" "<<num<<" ";
|
||
|
num=0;
|
||
|
}
|
||
|
}
|
||
|
cout<<endl;
|
||
|
p=1;
|
||
|
}
|
||
|
return 0;
|
||
|
}
|