C++學習2 - 枚舉型常量

#include<iostream>
using namespace std;

int main(){
 enum day{sun,mon,tue,wed,thu,fri,sat};
 day today;
 today = sat;
 if (today == sun || today == sat){
  cout << "zhoumu";
 }else{
  cout << "gongzuo";
 }
 system("pause");
 return 0;
}


更多詳情請點擊  http://blog.sina.com.cn/zhaojianjunzjj


 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章