1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
import
java.util.Scanner;
public
class
A03 {
/**
* @param args
*/
public
static
void
main(String[] args) {
// TODO Auto-generated method stub
Scanner input =
new
Scanner(System.in);
System.out.println(
"请输入您的成绩:"
);
int
Results = input.nextInt();
int
choice = Results /
10
;
String show =
""
;
switch
(choice) {
case
10
:
show =
"宝马"
;
break
;
case
9
:
show =
"电脑"
;
break
;
case
8
:
case
7
:
show=
"手机"
;
break
;
default
:
show=
"没有奖励!"
;
break
;
}
System.out.println(
"奖励物品:"
+show);
}
}
|
本文转自 Y幕徐 51CTO博客,原文链接:http://blog.51cto.com/765133133/1420177