Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- int i, j, x;
- cin >> x;
- for(i=2; i<=x; i++)
- {
- if(x%i==0)
- {
- for(j=0; x%i==0; j++)
- {
- x/=i;
- }
- cout << "(" << i << "^" << j << ")";
- if(x>1)cout << "*";
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment