Advertisement
nguyenhappy92

cho biết tháng thuộc quí mấy của năm

Oct 6th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. // Nhap vao thang cua 1 nam cho biet thang do thuoc quy may?
  2.  
  3. // Khai bao thu vien
  4. #include<conio.h>
  5. #include<stdio.h>
  6.  
  7. void main()
  8. {
  9. int thang;
  10. scanf("%d", &thang);
  11. if( thang==0|| thang >12||thang<0)
  12. {
  13. printf("Thang khong hop le");
  14. }
  15. else
  16. {
  17. switch(thang)
  18. {
  19. case 1: case 2: case 3: printf(" Quy 1\n");break;
  20. case 4: case 5:case 6: printf(" Quy 2\n");break;
  21. case 7: case 8: case 9: printf(" Quy 3\n");break;
  22. case 10: case 11: case 12: printf(" Quy 4\n");break;
  23. }
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement