c++编写程序 输出从公元1900~2010年间所有的闰年年份。要求每输出4个年份换一行。

[复制链接]
查看11 | 回复2 | 2010-6-5 14:46:43 | 显示全部楼层 |阅读模式
要有程序代码

回复

使用道具 举报

千问 | 2010-6-5 14:46:43 | 显示全部楼层
#include using namespace std;bool isLeapYear( int y ){ if( y%100== 0 )
// 世纪年 {if( y%400==0 ) return true; } else if( y%4==0 )
{return true; } return false; }int main(){ cout<<"公元1900~2010年间所有的闰年年份:"<<endl; int cnt=0; for( int i=1900; i<=2010; i++ ) {
回复

使用道具 举报

千问 | 2010-6-5 14:46:43 | 显示全部楼层
#include#include"conio.h"using namespace std;bool isleep(int year){
if(year%100==0){
if(year%400==0)return true;
else return f
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行