| 查看: 896 | 回复: 4 | ||
[求助]
哪位大侠帮我看看这个程序为什么运行不了啊!多谢了
|
|
class Time { Private: int hour; int minutes; int seconds; public: Time(); ~Time(); void SetTime(int _hour,int _minutes,int _seconds); void PrintTime(); int GetHour(); }; void Time:: SetTime(int _hour,int _minutes,int _seconds) { hour=_hour; minutes=_minutes; seconds=_seconds; return; } void Time:: PrintTime() { cout< } int Time::GetHour() { return hour; } Time::Time() { hour=_hour; minutes=_minutes; seconds=_seconds; } Time::~Time() { } #include #include"mytime.h" int main() { int hour; int minute; int second; cout<<"请输入时间(24小时制)小时:"; cin>>hour; cout<<"请输入时间(24小时制)分钟:"; cin>>minute; cout<<"请输入时间(24小时制)秒:"; cin>>second; Time mytime; mytime.SetTime(hour,minute,second); if(mttime.GetHour()>=1&&mytime.GetHour()<12) { cout<<"上午好"< else if(mytime.GetHour()>=12&&mytime.GetHour()<18) { cout<<"下午好"< else if(mytime.GetHour()>=18&&mytime.GetHour()<=24) { cout<<"晚上好"< else { cout<<"输入时间有误"< return 0; } [ Last edited by jjdg on 2012-8-3 at 01:07 ] |
» 猜你喜欢
参与限项
已经有3人回复
假如你的研究生提出不合理要求
已经有7人回复
实验室接单子
已经有4人回复
全日制(定向)博士
已经有4人回复
对氯苯硼酸纯化
已经有3人回复
求助:我三月中下旬出站,青基依托单位怎么办?
已经有12人回复
不自信的我
已经有12人回复
所感
已经有4人回复
要不要辞职读博?
已经有7人回复
北核录用
已经有3人回复
» 本主题相关价值贴推荐,对您同样有帮助:
请大侠帮我翻译一下一段文字吧,不要直译,散金币~~
已经有11人回复
下载了MATLAB2012可是安装不了。大侠帮帮忙谢谢
已经有13人回复
请各位大侠帮我看看这个关于ATRP反应怎么做,有没有必要这样做。谢谢。
已经有3人回复
哪位大侠帮帮忙翻译成英文谢谢
已经有3人回复
要哭了,使用AUTODOCK的大侠们来帮我看看,这个到底问题出在哪啊
已经有10人回复
MC一个简单的程序,运行不了,哪位大侠帮看看怎么回事。多谢!
已经有7人回复
各位大侠帮我看看,elsevier
已经有7人回复
哪位大侠帮我看看这个能级图是如何画出来的,不是能带图
已经有3人回复
大侠们帮我看看 editor invited 是啥意思啊
已经有17人回复
【求助】请大侠们帮我看看我的fdf文件对不对
已经有5人回复
【求助】哪位大侠帮我看看掺铝氧化锌的XRD图谱
已经有12人回复
【求助】有哪位大侠做过次氯酸叔丁酯啊?帮帮我啊!谢谢
已经有6人回复
【求助】请各位大侠看看这个gaussian为啥不能运行
已经有17人回复
【求助】哪位大侠能帮我计算一下这5个XRD数据的半高宽啊,急用,谢谢!
已经有3人回复
libralibra
至尊木虫 (著名写手)
骠骑将军
- 程序强帖: 40
- 应助: 817 (博后)
- 金币: 12914.1
- 红花: 64
- 帖子: 2238
- 在线: 287.3小时
- 虫号: 696514
- 注册: 2009-02-05
- 专业: 计算机软件

2楼2012-08-03 02:17:36
jackie1179
木虫 (正式写手)
- 应助: 11 (小学生)
- 金币: 1929.2
- 红花: 1
- 帖子: 460
- 在线: 47.2小时
- 虫号: 1119284
- 注册: 2010-10-11
- 专业: 生物信息学
3楼2012-08-03 10:47:43
断点~+++
金虫 (小有名气)
- 应助: 4 (幼儿园)
- 金币: 1138.9
- 散金: 5
- 红花: 2
- 帖子: 79
- 在线: 8.2小时
- 虫号: 1823478
- 注册: 2012-05-17
- 性别: GG
- 专业: 计算机软件
【答案】应助回帖
★ ★ ★ ★ ★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
学化学的笨蛋: 金币+10, ★★★★★最佳答案, 非常感谢 完全正确 可是我的程序是课本原文啊!怪事! 2012-08-03 21:09:20
感谢参与,应助指数 +1
学化学的笨蛋: 金币+10, ★★★★★最佳答案, 非常感谢 完全正确 可是我的程序是课本原文啊!怪事! 2012-08-03 21:09:20
|
#include using namespace std; class Time { private: int hour; int minutes; int seconds; public: Time(); ~Time(); void SetTime(int _hour,int _minutes,int _seconds); void PrintTime(Time&s); int GetHour(); }; void Time:: SetTime(int _hour,int _minutes,int _seconds) { hour=_hour; minutes=_minutes; seconds=_seconds; } void Time:: PrintTime(Time&s) { cout< } int Time::GetHour() { return hour; } Time::Time() { hour=0; minutes=0; seconds=0; } Time::~Time() { } #include using namespace std; int main() { int hour; int minutes; int seconds; cout<<"请输入时间(24小时制)小时:"; cin>>hour; cout<<"请输入时间(24小时制)分钟:"; cin>>minutes; cout<<"请输入时间(24小时制)秒:"; cin>>seconds; Time mytime; mytime.SetTime(hour,minutes,seconds); if(mytime.GetHour()>=1&&mytime.GetHour()<12) { cout<<"上午好"< else if(mytime.GetHour()>=12&&mytime.GetHour()<18) { cout<<"下午好"< else if(mytime.GetHour()>=18&&mytime.GetHour()<=24) { cout<<"晚上好"< else { cout<<"输入时间有误"< return 0; } 把#include"mytime.h"去了 在改了点 不知对不对 但在vc6.0能运行了 |
4楼2012-08-03 11:45:18
fzr417
木虫 (正式写手)
- 应助: 10 (幼儿园)
- 金币: 3523.7
- 散金: 10
- 帖子: 639
- 在线: 95.1小时
- 虫号: 573037
- 注册: 2008-06-13
- 性别: GG
- 专业: 计算机软件
5楼2012-08-11 10:41:47












回复此楼