Follows 300.c (Total 32 lines):

/* @JUDGE_ID:4461XX 300 C */
/* A */
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void main( void )
{
	unsigned long n , i ;
	char month[19][8] = { "pop" , "no" , "zip" , "zotz" , "tzec" , "xul" ,
	"yoxkin" , "mol" , "chen" , "yax" , "zac" , "ceh" , "mac" , "kankin" ,
	"muan" , "pax" , "koyab" , "cumhu" , "uayet" } ;
	char month_1[20][10] = { "imix" , "ik" , "akbal" , "kan" , "chicchan" ,
	"cimi" , "manik" , "lamat" , "muluk" , "ok" , "chuen" , "eb" , "ben" ,
	"ix" , "mem" , "cib" , "caban" , "eznab" , "canac" , "ahau" } ;
	scanf( "%lu\n" , &n ) ;
	printf( "%lu\n" , n ) ;
	for( i=0 ; i<n ; i++ )
	{
		char top[10] ; unsigned long day , year , j ;
		scanf( "%lu. %s %lu" , &day , top , &year ) ;
		day += 365 * year ;
		for( j=0 ; j<19 ; j++ )
			if( strcmp( top , month[j] )==0 ) { day += j * 20 ; break ; }
		day++ ;
		if( day%13!=0 ) printf( "%lu " , day%13 ) ;
		else printf( "%lu " , (unsigned long)13 ) ;
		if( day%20!=0 ) printf( "%s " , month_1[day%20-1] ) ;
		else printf( "%s " , month_1[19] ) ;
		if( day%260!=0 ) printf( "%lu\n" , day/260 ) ;
		else printf( "%lu\n" , day/260-1 ) ;
	}
}

Back to statistics
Ya-Lin Huang (C)
huangyl@gmail.com