1985/1/20 2006/3/12
20 71
#include <stdio.h> #include <stdlib.h> int main() { int days[]={31,28,31,30,31,30,31,31,30,31,30,31}; int month,day,year; //printf("Input date YYYY/MM/DD"); while(scanf("%d/%d/%d",&year,&month,&day)!=EOF) { days[1]=28; if((year%4==0&&year%100!=0)||(year%400==0)) days[1]++; for(year=0;year<month-1;year++) day+=days[year]; printf("%d\n",day); //system("pause"); // day=0; } return 0; }
版权声明:本文为博主原创文章,未经博主允许不得转载。
原文地址:http://blog.csdn.net/zhenzheni/article/details/47429069