import java.io.IOException;
import java.util.*;
/**
* @author wangyuan
*2015下午8:37:43
*TODO
*/
public class JudgeGB {
private static String[] name;
public static void main(String[] args) {
// TODO Auto-generated method stub
final int num = 10;
name = new String[num];
int score[];
score = new int[num];
System.out.println("input 10 student's name and score");
Scanner scan = new Scanner(System.in);
int i;
char ch = 0;
for (i = 0; i < 10; i++) {
System.out.println("please input " + (i + 1) + " name");
name[i] = scan.nextLine();
}
for (i = 0; i < 10; i++) {
System.out.println("please input " + (i + 1) + " score");
do {
score[i] = scan.nextInt();
} while (score[i] < 0 || score[i] > 100);
}
for (i = 0; i < 10; i++) {
switch (score[i] / 10) {
case 10:
case 9:
System.out.println(name[i] + "get score" + score[i] + "优秀");
break;
case 8:
case 7:
System.out.println(name[i] + "get score" + score[i] + "良好");
break;
case 6:
System.out.println(name[i] + "get score" + score[i] + "及格");
break;
default:
System.out.println(name[i] + "get score" + score[i] + "不及格");
break;
}
}
}
}
import java.util.*;
/**
* @author wangyuan
*2015下午8:37:43
*TODO
*/
public class JudgeGB {
private static String[] name;
public static void main(String[] args) {
// TODO Auto-generated method stub
final int num = 10;
name = new String[num];
int score[];
score = new int[num];
System.out.println("input 10 student's name and score");
Scanner scan = new Scanner(System.in);
int i;
char ch = 0;
for (i = 0; i < 10; i++) {
System.out.println("please input " + (i + 1) + " name");
name[i] = scan.nextLine();
}
for (i = 0; i < 10; i++) {
System.out.println("please input " + (i + 1) + " score");
do {
score[i] = scan.nextInt();
} while (score[i] < 0 || score[i] > 100);
}
for (i = 0; i < 10; i++) {
switch (score[i] / 10) {
case 10:
case 9:
System.out.println(name[i] + "get score" + score[i] + "优秀");
break;
case 8:
case 7:
System.out.println(name[i] + "get score" + score[i] + "良好");
break;
case 6:
System.out.println(name[i] + "get score" + score[i] + "及格");
break;
default:
System.out.println(name[i] + "get score" + score[i] + "不及格");
break;
}
}
}
}