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+=a[i];
  	t+=d;
  	if(y%4==0&&y%100!=0||y%400==0)
          if(m>2)
            t++;
          printf("%d",t);
}

Double click to view unformatted code.


Back to problem 81