.cpp(25): error C3861: “time”: 找不到标识符
#include<iostream>usingnamespacestd;classTime{public:voidset-time(void);voidshow-time...
#include <iostream>
using namespace std;
class Time
{
public:
void set-time(void);
void show-time(void);
int hour;
int minute;
int sec;
};
int Time::set-time()
{
cin>>hour>>minute>>sec;
}
int Time::show-time()
{
cout<<hour<<minute<<sec;
}
int main()
{
int Time.t;
t.set-time();
t.show-time();
return(0);
} 展开
using namespace std;
class Time
{
public:
void set-time(void);
void show-time(void);
int hour;
int minute;
int sec;
};
int Time::set-time()
{
cin>>hour>>minute>>sec;
}
int Time::show-time()
{
cout<<hour<<minute<<sec;
}
int main()
{
int Time.t;
t.set-time();
t.show-time();
return(0);
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询