- 谁拿了最多奖学金
- 2016-03-28 12:16:18 @
import java.util.ArrayList;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner cin = new Scanner(System.in);
int n = cin.nextInt(), sumReward = 0, maxLoc = 0;
ArrayList<Student> info = new ArrayList<Student>();
for (int i = 0; i < n; ++i) {
info.add(new Student(cin.next(), cin.nextInt(),
cin.nextInt(), cin.next(), cin.next(), cin.nextInt()));
sumReward += info.get(i).reward;
if (info.get(i).reward > info.get(maxLoc).reward) { maxLoc = i; }
}
System.out.println(info.get(maxLoc).name);
System.out.println(info.get(maxLoc).reward);
System.out.println(sumReward);
}
}
class Student {
String name;
int finalAverageScore;
int classCommentScore;
String isClassLeader;
String isWestStudent;
int paperQuentity;
int reward;
Student(String n, int fas, int ccs, String icl, String iws, int pq) {
name = n;
finalAverageScore = fas;
classCommentScore = ccs;
isClassLeader = icl;
isWestStudent = iws;
paperQuentity = pq;
reward = GetReward(0);
}
int GetReward(int arg) {
if (finalAverageScore > 80 && paperQuentity >= 1) {
arg += 8000;
}
if (finalAverageScore > 85 && classCommentScore > 80) {
arg += 4000;
}
if (finalAverageScore > 90) {
arg += 2000;
}
if (finalAverageScore > 85 && isWestStudent.equals("Y")) {
arg += 1000;
}
if (classCommentScore > 80 && isClassLeader.equals("Y")) {
arg += 850;
}
return arg;
}
}
2 条评论
-
1393973873 LV 6 @ 2016-07-13 08:47:03
我也就笑了
-
2016-07-13 08:46:51@
666
- 1