View Code of Problem 81

#include<stdio.h>
int main()
{
	int y,m,d,t=0,i;
	int a[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
	scanf("%d %d %d", &y, &m, &d);
	for(i=0;i<m;i++)
	{
		t = t+a[i]; 
	} 
	t = t + d;
	if(((y%4==0&&y%100!=0)||(y%400==0))&&m>2)
	{
		t = t + 1;
	}
	printf("%d", t);
	return 0; 
}

Double click to view unformatted code.


Back to problem 81