www问答网
所有问题
当前搜索:
用switch语句编写成绩
运用
switch语句编写
程序:按照考试
成绩
的五个等级A,B,C,D,E输入一个等...
答:
int s=score/10 char c = E;
switch
(s){ case 10:case 9: c = 'A'; break case 8: c = 'B'; break;case 7: c = 'C'; break;case 6: c = 'D'; break;default: c = 'E';}
用switch语句写成绩
大于等于80输出优秀,大于等于60输出及格
答:
include "iostream"using namespace std;void Print(int a){
switch
(a / 10){ case 6:case 7:printf("及格\n"); break;case 8:case 9:case 10: printf("优秀\n"); break;} } void main(){ int a;cin >> a;Print(a);system("pause");} ...
编写
C语言程序
用switch
结构或if
语句
输入
成绩
输出等级
答:
include \x0d\x0aint main() {\x0d\x0a int s, d;\x0d\x0a printf("输入
成绩
(百分制): ");\x0d\x0a scanf("%d", &s);\x0d\x0a d = s / 10;\x0d\x0a
switch
(d) {\x0d\x0a case 10:\x0d\x0a printf("满分。\n");\x0d\x...
如何
用switch
实现用户输入
成绩
判断用户输入错误?
答:
例:
用switch
来判断用户输入的
成绩
应该属于哪个范围。60一下不及格,60-70及格,70-80良好,80-90优秀,90以上学霸 var score=parseInt(prompt('请输入你的成绩'));switch(true){ case score>=0&&score<60:alert('不及格');break;case score>60&&score<=70:alert('及格');break;case score>...
编写
C语言程序
用switch
结构或if
语句
输入
成绩
输出等级
答:
include \x0d\x0aint main() {\x0d\x0a int s, d;\x0d\x0a printf("输入
成绩
(百分制): ");\x0d\x0a scanf("%d", &s);\x0d\x0a d = s / 10;\x0d\x0a
switch
(d) {\x0d\x0a case 10:\x0d\x0a printf("满分。\n");\x0d\x...
用switch语句
写出
成绩
大于等于80输出优秀大于等于60输出及格
答:
include "iostream"using namespace std;void Print(int a){
switch
(a / 10){ case 6:case 7:printf("及格\n"); break;case 8:case 9:case 10: printf("优秀\n"); break;} } void main(){ int a;cin >> a;Print(a);system("pause");} ...
C语言
使用switch 语句
,对学员的结业考试
成绩
评测
答:
int main(){ int score = 87; //这里只取一个值来做示例,实际上你应该用scanf或其他方式输入 score = score/10; //按题,这里只取整数部分来比较即可
switch
(score) { case 10: //100 case 9: //90~99 printf("优秀"); break; case 8: //...
C#里面
用switch
case
语句写
一个考试
成绩
评比程序怎么写啊,如大于90...
答:
个人意见:1、其实实现这样的效果大可不必
用switch
case
语句
来判断。2、直接用if语句就可实现(最简单的判断)3、如果你要对整个集体的
成绩
操作的话,可以用ICollection<T> int value="考试成绩";string valueStr="";string result="";//为输出的结果 if(value>80&&value<=90){ valueStr="80<...
...制考试
成绩
输出对应的等级(分别用if和
switch
,
写
两种)
答:
include <stdio.h>void judge1(int score);void judge2(int score);void main(){ int score=0; scanf("%d",&score); while(score!=-1) { judge1(score); judge2(score); scanf("%d",&score); } getch();}void judge1(int score){ if(score>=85) ...
在JAVA中
采用switch语句
设计一个程序,对给定的学生
成绩
score评判其等级...
答:
楼上的,楼主要求的是Java。import java.lang.*;import java.util.Scanner;public class test { public static void main(String[] args){ int score;Scanner sc=new Scanner(System.in);System.out.println("Please input the Score:");score=sc.nextInt();
switch
(score/10){ case 10:case 9...
<涓婁竴椤
1
2
3
4
5
6
7
8
9
10
涓嬩竴椤
灏鹃〉
其他人还搜