Hdoj1164 simple questions

From , 5 Years ago, written in C++, viewed 232 times.
URL https://pastebin.vip/view/13168e6a
  1. #include<iostream>
  2. #include<string>
  3. using namespace std;
  4.  
  5. int main(){
  6.         int m;
  7.         while(cin>>m){
  8.                 int count = 0;
  9.                 int i;
  10.                 for(i = 2; i < m; i++){
  11.                         if(m % i == 0){
  12.                                 /*if(m / i == 1){
  13.                                         cout<<"*"<<i;
  14.                                         break;
  15.                                 }*/
  16.                                 m /= i;
  17.                                 count++;
  18.                                 if(count == 1){
  19.                                         cout<<i;
  20.                                 }else{
  21.                                         cout<<"*"<<i;
  22.                                 }
  23.                                 i--;
  24.                         }
  25.                 }
  26.                 if(count == 0){
  27.                         cout<<m;
  28.                 }else{
  29.                         cout<<"*"<<i;
  30.                 }
  31.                 cout<<endl;
  32.         }
  33. }

Reply to "Hdoj1164 simple questions"

Here you can reply to the paste above

captcha

https://burned.cc - Burn After Reading Website