编程题 限C语言
发布网友
发布时间:2022-04-28 12:58
我来回答
共2个回答
热心网友
时间:2023-10-09 15:26
#include <stdio.h>
int main()
{
int age = 0;
while(1){
printf("请输入年龄:");
scanf("%d",&age);
if(age == 0)
{
break;
}
if(age>=2 && age <=3)
{
printf("此孩子分到小班\n");
}
else if(age == 4)
{
printf("此孩子分到中班\n");
}
else if(age >=5 && age<=6)
{
printf("此孩子分到大班\n");
}
else
{
printf("此孩子的年龄不在幼儿园的范围\n");
}
}
}
热心网友
时间:2023-10-09 15:26
#include<stdio.h>
void main()
{int i;
printf("please enter the age:\n");
scanf("%d",&i);
if(i>=2&&i<=6)
{ if(i==2||i==3)
printf("he or she should be in small class.\n");
else if(i==4)
printf("he or she should be in mid class.\n");
else
printf("he or she should be in big class.\n");}
else
printf("he or she can't be in the kindergarten.\n");
}
热心网友
时间:2023-10-09 15:26
#include <stdio.h>
int main()
{
int age = 0;
while(1){
printf("请输入年龄:");
scanf("%d",&age);
if(age == 0)
{
break;
}
if(age>=2 && age <=3)
{
printf("此孩子分到小班\n");
}
else if(age == 4)
{
printf("此孩子分到中班\n");
}
else if(age >=5 && age<=6)
{
printf("此孩子分到大班\n");
}
else
{
printf("此孩子的年龄不在幼儿园的范围\n");
}
}
}
热心网友
时间:2023-10-09 15:26
#include<stdio.h>
void main()
{int i;
printf("please enter the age:\n");
scanf("%d",&i);
if(i>=2&&i<=6)
{ if(i==2||i==3)
printf("he or she should be in small class.\n");
else if(i==4)
printf("he or she should be in mid class.\n");
else
printf("he or she should be in big class.\n");}
else
printf("he or she can't be in the kindergarten.\n");
}