Skip to content

Instantly share code, notes, and snippets.

@drage0
Created May 10, 2016 18:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drage0/81bde3d1d3dfcebfdddf27428323ddc9 to your computer and use it in GitHub Desktop.
Save drage0/81bde3d1d3dfcebfdddf27428323ddc9 to your computer and use it in GitHub Desktop.
#include<iostream>
using namespace std;
int main(void){
int x,y;
cin >> x;
y = 2;
while (x > 1){
while ((x % y) == 0){
cout << y << (((x/y)%y == 0)?'*':' ');
x = x / y;
}
y++;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment