小白求教,输入后输出的值与输入的值不相等,该怎么改?
此贴已删[此贴子已经被作者于2019-8-21 00:22编辑过]
#include <stdio.h> int main( void ) { unsigned hour, minute; if( scanf("%u : %u",&hour,&minute) != 2 ) { puts( "输入错误" ); return 1; } unsigned angle = ( 720 + (hour*60+minute)%720 - (minute*12)%720 )%720 / 2; if( angle > 180 ) angle = 360 - angle; printf( "%u\n", angle ); }