Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int n;
  4. int factor=2;
  5. int main()
  6. {
  7. cout<<"n=";
  8. cin>>n;
  9. while(n>1) {
  10. int putere=0;
  11. while((n%factor)==0){
  12. n=n/factor;
  13. putere=putere+1;}
  14. if(putere>0)
  15. cout<<factor<<" la puterea a "<<putere;
  16. factor=factor+1;}
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement