您的位置:首页 > 其它

hdoj1164简单题

2013-02-22 00:44 274 查看
#include<iostream>
#include<string>
using namespace std;

int main(){
int m;
while(cin>>m){
int count = 0;
int i;
for(i = 2; i < m; i++){
if(m % i == 0){
/*if(m / i == 1){
cout<<"*"<<i;
break;
}*/
m /= i;
count++;
if(count == 1){
cout<<i;
}else{
cout<<"*"<<i;
}
i--;
}
}
if(count == 0){
cout<<m;
}else{
cout<<"*"<<i;
}
cout<<endl;
}
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: