这是我编的程序, 交的时候说我有360个错误答案!我自己已经找了很久!但是我还是没有找到那些输出的答案是错误的!我真是快要崩溃了!
#include <stdio.h>
#include <stdlib.h>
#include<math.h>
int main()
{
int hour, minute;
float t;
scanf("%d%d", &hour, &minute);
while(hour!=0 || minute!=0)
{
if(hour>12 || hour < 1 || minute >=60 || minute < 0)
break;
t=fabs(hour*30+minute/2-minute*6);
if(t>=180 && minute >= 10)
printf("At %d:%d the angle is %.1f degrees.\n",hour, minute, 360-t);
else if(t>=180 && minute < 10)
printf("At %d:0%d the angle is %.1f degrees.\n",hour, minute, 360-t);
else if(t<180 && minute >= 10)
printf("At %d:%d the angle is %.1f degrees.\n",hour, minute, t);
else if(t<180 && minute<10)
printf("At %d:0%d the angle is %.1f degrees.\n",hour, minute, t);
scanf("%d%d", &hour, &minute);
}
return 0;
}