#include<iostream>
using namespace std;
class colck
{
public:
void settime(int newh = 0,int newm = 0,int news=0);
void showtime();
private:
int hour, minute, second;
};
void colck::settime(int newh , int newm , int news)
{
hour = newh;
minute = newm;
second = news;
}
void colck::showtime()
{
cout <<hour<<'-'<<minute<<'-'<<second<< endl;
}
int main()
{
colck mycolock;
mycolock.settime();
mycolock.showtime();
cout <<".............." << endl;
mycolock.settime(8, 30, 2);
mycolock.showtime();
system("pause");
return 0;
}
using namespace std;
class colck
{
public:
void settime(int newh = 0,int newm = 0,int news=0);
void showtime();
private:
int hour, minute, second;
};
void colck::settime(int newh , int newm , int news)
{
hour = newh;
minute = newm;
second = news;
}
void colck::showtime()
{
cout <<hour<<'-'<<minute<<'-'<<second<< endl;
}
int main()
{
colck mycolock;
mycolock.settime();
mycolock.showtime();
cout <<".............." << endl;
mycolock.settime(8, 30, 2);
mycolock.showtime();
system("pause");
return 0;
}
432

被折叠的 条评论
为什么被折叠?



