Advertisement
nguyenhappy92

Liệt kê tất cả ước số lẻ của số nguyên dương n

Oct 6th, 2015
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.26 KB | None | 0 0
  1. // Liet ke tat ca cac uoc so le cua so nguyen duong n
  2. // Khai bao thu vien
  3.  
  4. #include<stdio.h>
  5. #include<conio.h>
  6.  
  7. void main()
  8. {
  9. int n;
  10. scanf("%d",&n);
  11. for(int i=1;i<=n;i++)
  12. {
  13. if(n%i==0)
  14. {
  15. if(i%2!=0)
  16. {
  17. printf("%d\t",i);
  18. }
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement