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