View Code of Problem 56

#include<stdio.h>
#include<math.h>
int main()
{
	int s1,s2,f1,f2,m1,m2,t1,t2;
	scanf("%d:%d:%d",&s1,&f1,&m1);
	scanf("%d:%d:%d",&s2,&f2,&m2);
	t1=s1*3600+f1*60+m1;
	t2=s2*3600+f2*60+m2;
	t=t1-t2;
	s1=t/3600;
	f1=t%3600/60;
	m1=t%3600%60;
	printf("%d:%02d:%02d",s1,f1,m1);
	return 0; 
}
/*
Main.c: In function 'main':
Main.c:11:2: error: 't' undeclared (first use in this function)
  t=t1-t2;
  ^
Main.c:11:2: note: each undeclared identifier is reported only once for each function it appears in
*/

Double click to view unformatted code.


Back to problem 56