View Code of Problem 81

#include<stdio.h>
#include<math.h>
#include <string.h>
#define Max 1000
#include <stdio.h>
int main(void)
{
	int y,m,d,day,rem,i;
	int month[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
	while(scanf("%d %d %d",&y,&m,&d)!=EOF)
	{
		day=0;
		for(i=1;i<m;i++)
		   day=day+month[i];
		day=day+d;
		rem=y%	400;
		if(rem==0 && m>=2	)
		  day=day+1;
		  
		  printf("%d\n",day);
	}
    return 0;
}

Double click to view unformatted code.


Back to problem 81