/*
学习了运算符重载
*/
#include
using namespace std;
enum Num { sun,mon,tue,wed,tue,wed,thu,fri,sat};
Num& operator++(Num& n)
{
return n = (nine==n)? zero: Num(n+1);
}
void p(Num& n)
{
cout << n << endl;
}
int main()
{
Num k;
k=zero;
p(k);
for(int i=0; i < 15; ++i)
p(++k);
}
Rekomendasi Game Android Bahasa Indonesia
3 years ago
0 comments:
Post a Comment