标题:看我写的程序
取消只看楼主
hanshengchua
Rank: 1
等 级:禁止访问
威 望:2
帖 子:174
专家分:0
注 册:2006-5-8
 问题点数:0 回复次数:0 
看我写的程序
#include <iostream>
using namespace std;
class out_month
{
int month;
cout<<"Tell me a month number:";
cin>>month;
void days()
{
if(month<=7&&month!=2)
{
if(month%2==0)
cout<<"Month has 30 days"<<endl;
else
cout<<"Month has 31 days"<<endl;
}
else
{
if(month%2==0&&month!=2)
cout<<"Month has 31 days"<<endl;
else
{
if(month!=2)
cout<<"Month has 30 days"<<endl;
else
cout<<"Month has 28 or 29 days"<<endl;
}
}
}

};
int main()
{
out_month S1;
S1.days();
system("pause");
return 0;
}
编译的时候有错误,哪里出错了???
2006-05-09 22:47



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




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

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