一道c语言的题目,请各位帮帮忙急,急得很!!先谢谢各位!!
一道c语言的题目,请各位帮帮忙急,急得很!!先谢谢各位!!真不知道是哪里错了😣#include<stdio.h>intmain(){inth,min,se...
一道c语言的题目,请各位帮帮忙急,急得很!!先谢谢各位!!真不知道是哪里错了😣
#include<stdio.h>int main(){ int h,min,sec,t1,t2,t; while(~scanf("%d%d%d%d%d",&h,&min,&sec,&t1,&t2)) { if(t1>t2) {t=t1; t1=t2; t2=t;} h=h*30; min=min*6; sec=sec*6; t1=t1*30; t2=t2*30; printf("%d %d %d %d %d\n",h,min,sec,t1,t2); if(h==360) h=0; if(((h>t1&&h<t2)||(min>t1&&min<t2)||(sec>t1&&sec<t2))&& ((h>t2&&h<360||min>t2&&min<360||sec>t2&&sec<360)|| (h>=0&&h<t1||min>=0&&min<t1||sec>=0&&sec<t1))) printf("NO\n"); else printf("Yes\n"); } return 0;} 展开
#include<stdio.h>int main(){ int h,min,sec,t1,t2,t; while(~scanf("%d%d%d%d%d",&h,&min,&sec,&t1,&t2)) { if(t1>t2) {t=t1; t1=t2; t2=t;} h=h*30; min=min*6; sec=sec*6; t1=t1*30; t2=t2*30; printf("%d %d %d %d %d\n",h,min,sec,t1,t2); if(h==360) h=0; if(((h>t1&&h<t2)||(min>t1&&min<t2)||(sec>t1&&sec<t2))&& ((h>t2&&h<360||min>t2&&min<360||sec>t2&&sec<360)|| (h>=0&&h<t1||min>=0&&min<t1||sec>=0&&sec<t1))) printf("NO\n"); else printf("Yes\n"); } return 0;} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询