标签:
Description
Input
Output
Sample Input
Sample Output
1 #include <stdio.h> 2 int main(){ 3 int a[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; 4 int y, m, d, r, i; 5 while (scanf("%d/%d/%d", &y, &m, &d) == 3) 6 { 7 a[2] = y % 4==0&&y % 100!=0 || y % 400==0 ? 29 : 28; 8 r = 0; 9 for (i=1; i<m; ++i) 10 { 11 r += a[i]; 12 } 13 r += d; 14 printf("%d\n", r); 15 } 16 return 0; 17 }
标签:
原文地址:http://www.cnblogs.com/wangmengmeng/p/4552515.html