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