fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int h;
  5. printf("请输入一个代表小时数的整数(24小时制):\n");
  6. scanf("%d",&h);
  7. if(6<=h&&h<=8)printf("早上好");
  8. else if(8<h&&h<=12)printf("上午好");
  9. else if(12<h&&h<=18)printf("下午好");
  10. else if(18<h&&h<=24)printf("晚上好");
  11. else if(h<6)printf("凌晨好");
  12. else printf("该时间不可用");
  13. return 0;
  14. }
Success #stdin #stdout 0s 5328KB
stdin
24
stdout
请输入一个代表小时数的整数(24小时制):
晚上好