首页 > 代码库 > 年龄判断

年龄判断

#include <stdio.h>
void main()
{
int age;
printf("请输入年龄:\n");
scanf("%d",&age);
switch(age)
{
case 2:
case 3:
printf("孩子进入小班\n");
break;
case 4:
printf("孩子进入中班\n");
break;
case 5:
case 6:
printf("孩子进入中班\n");
break;
default:
printf("孩子年龄不在范围之内\n");
}
}