| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 513 人关注过本帖
标题:[求助]这程序通不过 大家看看哪错了
取消只看楼主 加入收藏
lzbcll
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-4-10
收藏
 问题点数:0 回复次数:2 
[求助]这程序通不过 大家看看哪错了

#ifndef time_h
#define time_h

class time{
public:
time();
void settime(int,int,int);
void printmilitary();
private:
int hour;
int minute;
int second;
};
#endif


#include <iostream.h>
#include "time.h"

time::time()
{hour=minute=second=0;}
void time::settime(int h,int m,int s)
{
hour = (h>=0&&h<24)?h:0;
minute = (m>=0&&m<60)?m:0;
second = (s>=0&&s<60)?s:0;
}
void time::printmilitary()
{
cout<<(hour<10?"0":"")<<hour<<":"<<(minute<10?"0":"")<<minute;
}

#include <iostream.h>
#include "time.h"

int main()
{
time t;
cout<<t.printmilitary();

t.settime(13,27,6);
cout<<t.printmilitary();

return 0;
}


通不过啊 说这有错 大家帮我看看啊

搜索更多相关主题的帖子: int time void minute 
2006-07-14 10:37
lzbcll
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-4-10
收藏
得分:0 
谢谢你
2006-07-14 10:52
lzbcll
Rank: 1
等 级:新手上路
帖 子:11
专家分:0
注 册:2006-4-10
收藏
得分:0 
还是不行啊 还是那里错啊

它显示是 STATEMENT MISSING ;
UNDEFINED SYMBOL 't'
2006-07-14 10:56
快速回复:[求助]这程序通不过 大家看看哪错了
数据加载中...
 
   



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

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