c语言 填空题 急求答案
1、输入三个数,并输出其中的最大值#include<stdio.h>main(){intnA,nB,nC,nT;printf("nA=");scanf("%d",&nA)...
1、输入三个数,并输出其中的最大值
#include <stdio.h>
main()
{ int nA,nB,nC,nT;
printf("nA=");
scanf("%d",&nA);
printf("nB=");
scanf("%d",&nB);
printf("nC=");
scanf("%d",&nC);
nT = nA;
if (____①____)
____②____
if (____③____)
____④____
printf("max:%d",nT);
}
①_________________________
②_________________________
③_________________________
④_________________________
2、判断输入字符是数字还是字母
#include <stdio.h>
main()
{ char cA;
cA = getchar();
if ('0'<=cA____①____cA<='9')
printf("num!\n");
if (('a'<=cA &&____②____)____③____ (____④____&& cA<='Z'))
printf("char!\n");
}
①_________________________
②_________________________
③_________________________
④_________________________
3、根据输入的分数输出等级,如果分数超出范围则输出err!
#include <stdio.h>
main()
{ float nNum;
int nTemp;
printf("Please input a num(0~100):");
scanf("%f",&nNum);
if(____①____)
{ nTemp = (int)( ____②____);
switch(nTemp)
{ ____③____ case 9:
printf("A\n");
____④____
case 8:
printf("B\n");
break;
case 7:
printf("C\n");
break;
case 6:
printf("D\n");
break;
____⑤____
printf("E\n"); }
}
else
{ ____⑥____ }
}
①_________________________
②_________________________
③_________________________
④_________________________
⑤_________________________
⑥_________________________ 展开
#include <stdio.h>
main()
{ int nA,nB,nC,nT;
printf("nA=");
scanf("%d",&nA);
printf("nB=");
scanf("%d",&nB);
printf("nC=");
scanf("%d",&nC);
nT = nA;
if (____①____)
____②____
if (____③____)
____④____
printf("max:%d",nT);
}
①_________________________
②_________________________
③_________________________
④_________________________
2、判断输入字符是数字还是字母
#include <stdio.h>
main()
{ char cA;
cA = getchar();
if ('0'<=cA____①____cA<='9')
printf("num!\n");
if (('a'<=cA &&____②____)____③____ (____④____&& cA<='Z'))
printf("char!\n");
}
①_________________________
②_________________________
③_________________________
④_________________________
3、根据输入的分数输出等级,如果分数超出范围则输出err!
#include <stdio.h>
main()
{ float nNum;
int nTemp;
printf("Please input a num(0~100):");
scanf("%f",&nNum);
if(____①____)
{ nTemp = (int)( ____②____);
switch(nTemp)
{ ____③____ case 9:
printf("A\n");
____④____
case 8:
printf("B\n");
break;
case 7:
printf("C\n");
break;
case 6:
printf("D\n");
break;
____⑤____
printf("E\n"); }
}
else
{ ____⑥____ }
}
①_________________________
②_________________________
③_________________________
④_________________________
⑤_________________________
⑥_________________________ 展开
2个回答
展开全部
一。 if (nT<nB)
nT=nB;
if (nT<nC)
nT=nC;
二。 if ('0'<=cA&&cA<='9')
printf("num!\n");
if (('a'<=cA &&cA<='z')||('A'<=cA&& cA<='Z'))
三。#include <stdio.h>
main()
{ float nNum;
int nTemp;
printf("Please input a num(0~100):");
scanf("%f",&nNum);
if(nNum>=0&&nNum<=100)
{ nTemp = (int)(nNum);nTemp=nTemp/10;
switch(nTemp)
{
case 9:
printf("A\n");
break;
case 8:
printf("B\n");
break;
case 7:
printf("C\n");
break;
case 6:
printf("D\n");
break;
default :
printf("E\n"); }
}
else
{printf("the num is wrong ,Input again!");}
getch();
}
nT=nB;
if (nT<nC)
nT=nC;
二。 if ('0'<=cA&&cA<='9')
printf("num!\n");
if (('a'<=cA &&cA<='z')||('A'<=cA&& cA<='Z'))
三。#include <stdio.h>
main()
{ float nNum;
int nTemp;
printf("Please input a num(0~100):");
scanf("%f",&nNum);
if(nNum>=0&&nNum<=100)
{ nTemp = (int)(nNum);nTemp=nTemp/10;
switch(nTemp)
{
case 9:
printf("A\n");
break;
case 8:
printf("B\n");
break;
case 7:
printf("C\n");
break;
case 6:
printf("D\n");
break;
default :
printf("E\n"); }
}
else
{printf("the num is wrong ,Input again!");}
getch();
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询