#include <stdio.h>#include <stdlib.h>int main(int agrc,char*agrv[]){    int month,year;   int day1[12]={31,28,31,30,31,30,31,31,30,31,30,31};   int day2[12]={31,29,31,30,31,30,31,31,30,31,30,31};   do{    scanf("%d%d",&year,&month);   }while(month<1&&month>12);//处理不合法输入的数据   if(year%4==0&&year%100!=0||year%400==0)   {       printf("%d\n",day2[month-1]);   }   else{       printf("%d\n",day1[month-1]);   }return 0;}


©著作权归作者所有:来自51CTO博客作者知的原创作品,如需转载,请注明出处,否则将追究法律责任

更多相关文章

  1. BRCM5.02编译五: fatal error: uuid/uuid.h: No such file or dir
  2. BRCM5.02编译十:cmake: command not found
  3. BRCM5.02编译二:Error: Could not retreive version from automak
  4. BRCM5.02编译八: ERROR: you are missing a basic functioning pe
  5. BRCM5.02编译九:cannot find -lncurses
  6. BRCM5.02编译四: ERROR: lzo/lzo1x.h development library is req
  7. BRCM5.02编译三 : Error: Could not retreive version from libto
  8. BRCM5.02编译一 : 缺少工具链路
  9. ssh登录日志收集

随机推荐

  1. 编码不规范,同事真的会两行泪?
  2. 面试官问我,SpringApplication.run做了哪
  3. 自学第四十八天
  4. 谁在关心toString的性能?
  5. Monadic Function_Haskell笔记12
  6. 从JDK中,我们能学到哪些设计模式?
  7. 为什么这段代码输出的是 ”Hello World”
  8. 10 行 Java 代码实现最近被使用(LRU)缓存
  9. 在 Java 中正确使用注释
  10. Java 并发的四种风味:Thread、Executor、F