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