#include <stdio.h>
int main()
{
int h1,h2;
int m1,m2;
printf("输入现在的时间%d %d");
scanf("%d %d",&h1,&m1);
printf("输入过去的时间%d %d");
scanf("%d %d",&h2,&m2);
printf("%d",h1*60+m1-h2*60+m2);
return 0;
}
#include <stdio.h>
int main()
{
int h1,h2;
int m1,m2;
printf("输入现在的时间%d %d");
scanf("%d %d",&h1,&m1);
printf("输入过去的时间%d %d");
scanf("%d %d",&h2,&m2);
printf("%d",h1*60+m1-h2*60+m2);
return 0;
}
//printf("%d",h1*60+m1-h2*60+m2);改成下面的
printf("%d",h1*60+m1-(h2*60+m2));