Advertisement
nguyenhappy92

Đếm số lượng ước số chẵn của số nguyên dương n

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