枚举类型不一定要在 main 中定义:
#include<iostream>
usingnamespace std;
enum time
{
first,second,
third,forth,fifth
};
int main()
{
enum time a=fifth;
if(a==fifth)
{
cout <<"Succeed!";
}
return0;
}
枚举类型不一定要在 main 中定义:
#include<iostream>
usingnamespace std;
enum time
{
first,second,
third,forth,fifth
};
int main()
{
enum time a=fifth;
if(a==fifth)
{
cout <<"Succeed!";
}
return0;
}