输入年(包含闰年)和月份,输出天数
16lz
2021-04-19
#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;}
更多相关文章
- BRCM5.02编译五: fatal error: uuid/uuid.h: No such file or dir
- BRCM5.02编译十:cmake: command not found
- BRCM5.02编译二:Error: Could not retreive version from automak
- BRCM5.02编译八: ERROR: you are missing a basic functioning pe
- BRCM5.02编译九:cannot find -lncurses
- BRCM5.02编译四: ERROR: lzo/lzo1x.h development library is req
- BRCM5.02编译三 : Error: Could not retreive version from libto
- BRCM5.02编译一 : 缺少工具链路
- ssh登录日志收集