5.2 分别用if结构和switch结构编写程序
来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/07/17 02:53:01
5.2 分别用if结构和switch结构编写程序
分别用if结构和switch结构编写程序,对输入的一个百分制成绩,输出成绩的等级:90分以上为A等,80~89分为B等,70分~79分为C等,60~69分为D等,低于60分为E等.
分别用if结构和switch结构编写程序,对输入的一个百分制成绩,输出成绩的等级:90分以上为A等,80~89分为B等,70分~79分为C等,60~69分为D等,低于60分为E等.
main()
{
int score;
scanf("%d",&score);
switch(int(score/10))
{
case 10:
case 9: printf("Your score is A\n");break;
case 8: printf("Your score is B\n");break;
case 7: printf("Your score is C\n");break;
case 6: printf("Your score is D\n");break;
default: printf("Your score is E\n");
}
}
main()
{
int score;
scanf("%d",&score);
if(score>=90)
{printf("Your score is A\n");}
if(score>=80&&score=70&&score=60&&score
再问: 朋友辛苦了,下次编完请检查一下!
{
int score;
scanf("%d",&score);
switch(int(score/10))
{
case 10:
case 9: printf("Your score is A\n");break;
case 8: printf("Your score is B\n");break;
case 7: printf("Your score is C\n");break;
case 6: printf("Your score is D\n");break;
default: printf("Your score is E\n");
}
}
main()
{
int score;
scanf("%d",&score);
if(score>=90)
{printf("Your score is A\n");}
if(score>=80&&score=70&&score=60&&score
再问: 朋友辛苦了,下次编完请检查一下!
C语言,分别用if 语句和switch语句编写程序求分段函数的值
C语言:用循环结构分别编写程序
用if语句和switch语句分别编写程序,实现以下功能:从键盘输入数字1,2,3,4,分别显示Excellent,Goo
简单的C语言题 编写一程序,要求输入x的值,输出y的值.要求分别用switch语句和嵌套的if语句写.
编写一段程序,要求输入x的值,输出y的值,分别用不嵌套if语句,嵌套语句,if else语句,switch语句,编写
用matlab编写函数文件:分别用 for 和 while 循环结构编写程序,求 2 的 0 到 15 次幂的和
用三种循环结构分别编写程序,计算л的近似值
编写函数文件:分别用 for 和 while 循环结构编写程序,求 2 的 0 到 15 次幂的和.
编写程序,用双循环结构输出下列三角形:1222333334444444
编写程序,用双循环结构输出下列三角形,加急!
要求用if-else if-else结构编写一个程序,根据用户输入的期末考试成绩,输出相应的成绩评定信息.成绩大于等于9
分别使用while、do…while、for三种循环结构编写3个程序