Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.24 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6.  
  7. {
  8.  
  9. int n, x, i, j, div;
  10.  
  11. cin>>n;
  12.  
  13. for(i=0; i<n; i++)
  14.  
  15. {
  16.  
  17. cin>>x;
  18.  
  19. for(j=1; j<=x; j++)
  20.  
  21. {
  22.  
  23. if(x%j==0 && j%2==1)
  24.  
  25. div=j;
  26.  
  27. }
  28.  
  29. cout<<div<<" ";
  30.  
  31. }
  32.  
  33. return 0;
  34.  
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement