标题:求教!!!判断是否为闰年
取消只看楼主
zhanghang123
Rank: 2
等 级:论坛游民
帖 子:39
专家分:24
注 册:2010-3-20
结帖率:100%
已结贴  问题点数:10 回复次数:0 
求教!!!判断是否为闰年
程序代码:
#include<iostream.h>
class runnian
{
public:
    runnian();
protected:
    int year;
};


runnian::runnian(int t=0)
{
    strcpy(year,t);
    if(0<t<9999)
    {
        if((t%4==0&&t%100!=0)||(t%400==0)
            cout<<t<<"是闰年"<<endl;
        else
            cout<<t<<"不是闰年"<<endl;
    }
    else
        reture ERROR:
}
int mian()
{
    runnian a;
    int y;
    cout<<"请输入一个年份:"<<endl;
    cin>>y;
    a.runnian();
}
自己写的程序,请大家帮忙改改,谢谢!!
搜索更多相关主题的帖子: 闰年 判断 
2010-12-22 00:19



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-329545-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.194235 second(s), 8 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved