发布网友 发布时间:2022-04-24 18:31
共2个回答
热心网友 时间:2023-11-01 13:54
#include<stdio.h>
#include<conio.h>
main()
{
char a,b,c;
clrscr();
printf("Do you have Experience with C? Press y/n\n");
scanf("%c",&a);
fflush(stdin);//添加,清空缓冲区
switch(a)//有错
{
case 'N':
case 'n':printf("We are so sorry tell you...");break;
case 'Y':
case 'y':printf("What is your bachelor degree? Press y/n\n");
scanf("%c",&b);
fflush(stdin);//添加,清空缓冲区
switch(b)//有错
{
case 'N':
case 'n':printf("We are so sorry to tell you...");break;
case 'Y':
case 'y':printf("Your age less than 30? Press y/n\n");
scanf("%c",&c);
fflush(stdin);//添加,清空缓冲区
switch(c)//有错
{
case 'N':
case 'n':printf("We are so sorry to tell you...");break;
case 'Y':
case 'y':printf("Welcome join us!");
}
}
}
getch();
}
热心网友 时间:2023-11-01 13:54
已测试
#include<stdio.h>
#include<conio.h>
main()
{
char a,b,c;
clrscr();
printf("Do you have Experience with C? Press y/n\n");
scanf("%c",&a);
getchar();
switch(a)
{
case 'N':
case 'n':printf("We are so sorry tell you...");break;
case 'Y':
case 'y':printf("What is your bachelor degree? Press y/n\n");scanf("%c",&b);getchar();
switch(b)
{
case 'N':
case 'n':printf("We are so sorry to tell you...");break;
case 'Y':
case 'y':printf("Your age less than 30? Press y/n\n");scanf("%c",&c);getchar();
switch(c)
{
case 'N':
case 'n':printf("We are so sorry to tell you...");break;
case 'Y':
case 'y':printf("Welcome join us!");
}
}
}
getch();
}