Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 29) A
- 30) A
- 31) B
- 32) D
- 33) B
- //6
- public class ArrayTwoD {
- public static void main(String[] args) {
- String[][] list = { {"a", "b", "a", "c", "c", "d", "e", "e", "a", "d"},
- {"d", "b", "a", "b", "c", "a", "e", "e", "a", "d"},
- {"e", "d", "d", "a", "c", "b", "e", "e", "a", "d"},
- {"c", "b", "a", "e", "d", "c", "e", "e", "a", "d"},
- {"a", "b", "d", "c", "c", "d", "e", "e", "a", "d"},
- {"b", "b", "e", "c", "c", "d", "e", "e", "a", "d"},
- {"b", "b", "a", "c", "c", "d", "e", "e", "a", "d"},
- {"e", "b", "e", "c", "c", "d", "e", "e", "a", "d"} };
- int[] score = new int[list.length];
- String[] key = {"d", "b", "d", "c", "c", "d", "a", "e", "a", "d"};
- for (int i=0;i<list.length;i++){
- for (int j=0;j<list[i].length;j++){
- if (list[i][j] == key[j])score[i]++;
- }
- }
- for (int i=0;i<score.length;i++){
- System.out.print(i + ": " + score[i] + " | ");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement