View Code of Problem 81

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

Double click to view unformatted code.


Back to problem 81