编写函数,判断year是否为闰年,若是则返回1,否则返回0
来源:互联网 发布:matlab软件介绍 编辑:程序博客网 时间:2024/05/16 17:35
#include <iostream>
using namespace std;
int hhh(int year)
{
int x;
if (year % 100 != 0 && year % 4 == 0 || year % 100 == 0 && year % 400 != 0)
x = 1;
else x = 0;
return x;
}
void main()
{
int a;
cin >> a;
cout << hhh(a);
}
using namespace std;
int hhh(int year)
{
int x;
if (year % 100 != 0 && year % 4 == 0 || year % 100 == 0 && year % 400 != 0)
x = 1;
else x = 0;
return x;
}
void main()
{
int a;
cin >> a;
cout << hhh(a);
}
阅读全文
0 0
- 编写函数,判断year是否为闰年,若是则返回1,否则返回0
- 试编一函数:判断字符串是否为回文.若是则函数值返回0.否则返回1?
- 编写函数判断一个年是否是闰年,是闰年返回ture,不是闰年返回false。
- 输入一个年份判断是否为闰年,是就返回TRUE,否则就返回FALSE.cpp
- 判断是否为素数,是则返回1,否则返回0.
- 判断year年份是否为闰年(能被4整除是闰年,能被整除100不是,能被400整除是闰年)。闰年leap_year为1,否则为0.
- 第二章作业51.4(编写一个程序,判断用户输入的字符是否为数字,若是数字,则输出“a numerical charater”,否则输出“other charater”。)
- 编写函数判断是否闰年
- 是否是闰年判断函数:BOOL IsLeapYear (int year)
- 一个C函数,若处理器是Big_endian的,则返回0;若是Little_endian的,则返回1
- 请写一个C函数,若处理器是Big_endian的,则返回0;若是Little_endian的,则返回1
- 请写一个C函数,若处理器是Big_endian的,则返回0;若是Little_endian的,则返回1
- 请写一个C函数,若处理器是Big_endian的,则返回0;若是Little_endian的,则返回1
- 判断一字符串是否为回文,是返回1,不是返回0,出错返回-1
- 查询判断某个字段是否为空 不为空返回1 为空返回0
- 请写出一个宏定义,用以判断一个C是否是字母字符,若是,得1,否则得0
- P51 第4题 编写一个程序,判断用户输入的字符是否是数字,若是数字,则输出“a numerical character”,否则输出“other character”.
- 写一函数int fun(char *p)判断一字符串是否为回文,是返回1,不是返回0,出错返回-1
- angularjs综合
- centos6.4安装LNMP环境详细安装
- 基于SSD的图片文本检测及快速方法
- mysql 创建数据库和表的相关操作
- 2017年11月21日学习总结__关于函数的定义的说明以及递归函数
- 编写函数,判断year是否为闰年,若是则返回1,否则返回0
- 查询历史表和当前出现的问题
- 171121 Differences between the L1-norm and the L2-norm
- CEdit换行和GetLine乱码
- 自学与复习设计模式笔记(2)单例模式
- 对象跟字符串相互转换
- Hadoop完全分布式安装Kafka
- Dagger2解耦简易版
- 浅谈HTML