Language: C

#define zone(h) ( (11<=(h)&&(h)<15)?0:(18<=(h)&&(h)<21)?1:(21<=(h)&&(h)<26)?2:3 )
int a[3],b[3];
char s[9];char *r(int i){strcpy(s,"no guest");if(a[i])sprintf(s,"%d",b[i]*100/a[i]);return s;}
main(n,h,m,H,M){
	for(;scanf("%d",&n),n){
		a[0]=a[1]=a[2]=b[0]=b[1]=b[2]=0;
		for(;n;n--){
			scanf("%d:%d %d",&h,&m,&M);
			if(h<2)h+=24;
			H=M<m?h+1:h;
			if(zone(H)>2)continue;
			a[zone(H)]++;
			if((H*60+M)-(h*60+m)<=8)b[zone(H)]++;
		}
		printf("lunch %s\n",r(0));
		printf("dinner %s\n",r(1));
		printf("midnight %s\n",r(2));
	}
	return 0;
}

Compiler output:
main.c: In function 'r':
main.c:3:26: error: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration]
    3 | char s[9];char *r(int i){strcpy(s,"no guest");if(a[i])sprintf(s,"%d",b[i]*100/a[i]);return s;}
      |                          ^~~~~~
main.c:1:1: note: include '<string.h>' or provide a declaration of 'strcpy'
  +++ |+#include <string.h>
    1 | #define zone(h) ( (11<=(h)&&(h)<15)?0:(18<=(h)&&(h)<21)?1:(21<=(h)&&(h)<26)?2:3 )
main.c:3:26: warning: incompatible implicit declaration of built-in function 'strcpy' [-Wbuiltin-declaration-mismatch]
    3 | char s[9];char *r(int i){strcpy(s,"no guest");if(a[i])sprintf(s,"%d",b[i]*100/a[i]);return s;}
      |                          ^~~~~~
main.c:3:26: note: include '<string.h>' or provide a declaration of 'strcpy'
main.c:3:55: error: implicit declaration of function 'sprintf' [-Wimplicit-function-declaration]
    3 | char s[9];char *r(int i){strcpy(s,"no guest");if(a[i])sprintf(s,"%d",b[i]*100/a[i]);return s;}
      |                                                       ^~~~~~~
main.c:1:1: note: include '<stdio.h>' or provide a declaration of 'sprintf'
  +++ |+#include <stdio.h>
    1 | #define zone(h) ( (11<=(h)&&(h)<15)?0:(18<=(h)&&(h)<21)?1:(21<=(h)&&(h)<26)?2:3 )
main.c:3:55: warning: incompatible implicit declaration of built-in function 'sprintf' [-Wbuiltin-declaration-mismatch]
    3 | char s[9];char *r(int i){strcpy(s,"no guest");if(a[i])sprintf(s,"%d",b[i]*100/a[i]);return s;}
      |                                                       ^~~~~~~
main.c:3:55: note: include '<stdio.h>' or provide a declaration of 'sprintf'
main.c: At top level:
main.c:4:1: error: return type defaults to 'int' [-Wimplicit-int]
    4 | main(n,h,m,H,M){
      | ^~~~
main.c: In function 'main':
main.c:4:1: error: type of 'n' defaults to 'int' [-Wimplicit-int]
main.c:4:1: error: type of 'h' defaults to 'int' [-Wimplicit-int]
main.c:4:1: error: type of 'm' defaults to 'int' [-Wimplicit-int]
main.c:4:1: error: type of 'H' defaults to 'int' [-Wimplicit-int]
main.c:4:1: error: type of 'M' defaults to 'int' [-Wimplicit-int]
main.c:5:14: error: implicit declaration of function 'scanf' [-Wimplicit-function-declaration]
    5 |         for(;scanf("%d",&n),n){
      |              ^~~~~
main.c:5:14: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:14: warning: incompatible implicit declaration of built-in function 'scanf' [-Wbuiltin-declaration-mismatch]
main.c:5:14: note: include '<stdio.h>' or provide a declaration of 'scanf'
main.c:5:30: error: expected ';' before ')' token
    5 |         for(;scanf("%d",&n),n){
      |                              ^
      |                              ;
main.c:15:17: error: implicit declaration of function 'printf' [-Wimplicit-function-declaration]
   15 |                 printf("lunch %s\n",r(0));
      |                 ^~~~~~
main.c:15:17: note: include '<stdio.h>' or provide a declaration of 'printf'
main.c:15:17: warning: incompatible implicit declaration of built-in function 'printf' [-Wbuiltin-declaration-mismatch]
main.c:15:17: note: include '<stdio.h>' or provide a declaration of 'printf'