闰年计算器呀
一、知识点
1、表达式中数据类型的转换
(类型名)(表达式)
例如
(double)a 将a转换为double
(int)(x=y) 将x=y转换为int
(float)(5%3) 将5%3转换为float
注:括号不能省略
今天的代码来喽
#include "stdafx.h"
#include
using namespace std;int _tmain(int argc, _TCHAR* argv[])
{int x;cout << "请输入需要判断的年份" << endl;cin >> x;if (x % 4 != 0 || x % 400 == 0)cout << "该年份不是闰年" << endl;elsecout << "该年是闰年" << endl;cin.get();cin.get();return 0;
}
今天也要努力吖
I hope you can keep half of your loveliness
and gentleness under all kinds of
difficulties in life.
在生活的万般刁难下
愿你留住半分可爱和温柔
本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!
