enum week{
monday=1,
tuesday,
wednesday,
thursday,
friday,
saturday,
sunday
};
printf("请输入一个数 \n");
int number = 0;
scanf("%d",&number);
switch (number) {
case monday:
printf("上课敲代码!下课看无码!第%d天",number);
break;
case tuesday:
printf("上课敲代码!下课看无码!第%d天",number);
break;
case wednesday:
printf("上课敲代码!下课看无码!第%d天",number);
break;
case thursday:
printf("上课敲代码!下课看无码!第%d天",number);
break;
case friday:
printf("上课敲代码!下课看无码!第%d天",number);
break;
case saturday:
printf("上课敲代码!下课看无码!第%d天",number);
break;
case sunday:
printf("上课敲代码!下课看无码!第%d天",number);
break;
default:
printf("看多了!!!%d",number);
break;
}
宏:只做简单的替换,在预编译的时候就完成替换
宏名:纯大写
K+大驼峰命名法 如:KArray
有参数,在做替换时,只做简单的替换,不会判断运算符优先级
const int m=0;
m=1; //error,被const修饰的变量是不能被重新赋值的