C语言作业——反复校验用户输入的生日,包括年、月、日。直到年、月、日都合法。
来源:互联网 发布:人人网外推软件 编辑:程序博客网 时间:2024/05/29 00:32
// 7.(****)反复校验用户输入的生日,包括年、月、日。直到年、月、日都合法。
// int year,mouth,day;
// int i=1;
// while (i) {
// printf("请输入正确的生日:\n");
// scanf("%d%d%d",&year,&mouth,&day);
// if (year>0 && year<2015) {
//
// if ( year%400==0||( year%4==0 && year%100!=0))
// {
//
// if (mouth<=12&&mouth>0)
// {
// if (mouth==1||mouth==3||mouth==5||mouth==7||mouth==8||mouth==10||mouth==12)
// {
// if (day<=31&&day>0)
// {printf("it is right style.\n") ;i=0;}
// else {
// printf("it is not right style .\n");
//
// }
//
// } else if(mouth==2) {
// if (day<30&&day>0)
// {printf("it is right style.\n") ;i=0;}
// else {printf("it is not right style .\n");}
// }else if (mouth==4||mouth==6||mouth==9||mouth==11){
//
// if (day<=30&&day>0)
// {printf("it is right style.\n") ;i=0;}
// else {printf("it is not right style .\n");}
//
// }
// }else {printf("it is not right style .\n");}
//
// }
//
//
// else{
//
// if (mouth<=12 && mouth>0)
// {
//
// if (mouth==1 || mouth==3 || mouth==5 || mouth==7 || mouth==8 || mouth==10 || mouth==12)
// {
// if (day<=31&&day>0)
// {printf("it is right style.\n") ;i=0;}
// else {printf("it is not right style .\n");}
//
// } else if(mouth==2) {
// if (day<=28&&day>0)
// {printf("it is right style.\n") ;i=0;}
// else {printf("it is not right style .\n");}
// }else if (mouth==4||mouth==6||mouth==9||mouth==11){
//
// if (day<=30&&day>0)
// {printf("it is right style.\n") ;i=0;}
// else {printf("it is not ok.\n");}
//
// }
// }else {printf("it is not right style .\n");}
// }
//
// }
// else{
// printf("it is not right style .\n");
// }
// }
// int year,mouth,day;
// int i=1;
// while (i) {
// printf("请输入正确的生日:\n");
// scanf("%d%d%d",&year,&mouth,&day);
// if (year>0 && year<2015) {
//
// if ( year%400==0||( year%4==0 && year%100!=0))
// {
//
// if (mouth<=12&&mouth>0)
// {
// if (mouth==1||mouth==3||mouth==5||mouth==7||mouth==8||mouth==10||mouth==12)
// {
// if (day<=31&&day>0)
// {printf("it is right style.\n") ;i=0;}
// else {
// printf("it is not right style .\n");
//
// }
//
// } else if(mouth==2) {
// if (day<30&&day>0)
// {printf("it is right style.\n") ;i=0;}
// else {printf("it is not right style .\n");}
// }else if (mouth==4||mouth==6||mouth==9||mouth==11){
//
// if (day<=30&&day>0)
// {printf("it is right style.\n") ;i=0;}
// else {printf("it is not right style .\n");}
//
// }
// }else {printf("it is not right style .\n");}
//
// }
//
//
// else{
//
// if (mouth<=12 && mouth>0)
// {
//
// if (mouth==1 || mouth==3 || mouth==5 || mouth==7 || mouth==8 || mouth==10 || mouth==12)
// {
// if (day<=31&&day>0)
// {printf("it is right style.\n") ;i=0;}
// else {printf("it is not right style .\n");}
//
// } else if(mouth==2) {
// if (day<=28&&day>0)
// {printf("it is right style.\n") ;i=0;}
// else {printf("it is not right style .\n");}
// }else if (mouth==4||mouth==6||mouth==9||mouth==11){
//
// if (day<=30&&day>0)
// {printf("it is right style.\n") ;i=0;}
// else {printf("it is not ok.\n");}
//
// }
// }else {printf("it is not right style .\n");}
// }
//
// }
// else{
// printf("it is not right style .\n");
// }
// }
0 0
- C语言作业——反复校验用户输入的生日,包括年、月、日。直到年、月、日都合法。
- 【c语言】反复校验用户输入的生日,包括年、月、日。直到年、月、日都合法。
- C语言 反复校验用户输入的生日,包括年、月、日。直到年、月、日都合法
- 反复校验用户输入的日期,直到年、月、日都合法,计算该日在本年中为第几天?(注意考虑闰年问题)
- C语言习题——提示输入3个整数值,分别代表日,月,年
- 问题十五:定义一个结构体变量(包括年、月、日),输入两个人的生日,求出他们相差多少天。
- 文本框TextBox输入特定格式(“年-月-日”)的生日
- 10月 24 日 c语言 从键盘上连续输入字符,并统计其中大写字母的个数,直到输入“换行”字符时结束。
- 问题十四:定义一个结构体变量(包括年、月、日),要求输入年、月、日,计算输出该日是该年的第几天。
- 2017年10月19日作业
- 2017年10月20日作业
- 2017年10月25日作业
- 2017年10月30日作业
- 2017年10月31日作业
- 2017年11月02日作业
- 2017年11月04日作业
- 2017年11月6日作业
- 2017年11月8日作业
- 黑马程序员-Java异常体系结构
- 虚拟机下ubuntu10.04搭建hadoop1.2.1
- Windows Phone 7 如何获取用户和手机的信息
- MFC学习注意
- wamp不能使用phpmyadmin,提示“You don't have permission to access /phpmyadmin/ on this server.”
- C语言作业——反复校验用户输入的生日,包括年、月、日。直到年、月、日都合法。
- 应用程序基础及组件
- 0075 Hibernate:Query.iterator()的N+1问题【基础】
- ubuntu apt-get 相关参数
- 导入DBF文件方法
- Wireshark学习与开发资料
- 产品需求文档(PRD)的写作方法
- 黑马程序员-javaIO总结 续——其他常用与IO流有关的对象
- Linuxubuntu chmod和chown命令用法详细介绍