CristinaGeorgiu

ordonare descrescatoare divizori

Nov 20th, 2019
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.24 KB | None | 0 0
  1. #include<iostream>
  2. using namespace std;
  3. int main()
  4. {
  5. int x,d,n;
  6. cin>>x;
  7. n=x/2;
  8. cout<<"1"<<" ";
  9. for(d=2; n; d++)
  10.  
  11. {
  12. if(x%d==0)
  13. {
  14. cout<<d<<" ";
  15. }
  16. }
  17.  
  18. return 0;
  19. }
Add Comment
Please, Sign In to add comment