importjava.util.*;publicclassMain{publicstaticvoidmain(String[] args){Scanner sc =newScanner(System.in);while(sc.hasNext()){int x = sc.nextInt();int y = sc.nextInt();int z = sc.nextInt();int[][] arr1 =newint[x][y];int[][] arr2 =newint[y][z];for(int i =0; i < x ; i++){for(int j =0; j < y ; j++){arr1[i][j]= sc.nextInt();}}for(int i =0; i < y ; i++){for(int j =0; j < z ; j++){arr2[i][j]= sc.nextInt();}}int[][] newArr =newint[x][z];for(int i =0; i < x ; i++){for(int j =0; j < z ; j++){for(int k =0; k < y ; k++){newArr[i][j]+= arr1[i][k]* arr2[k][j];}}}for(int i =0; i < x ; i++){for(int j =0; j < z ; j++){System.out.print(newArr[i][j]+" ");}System.out.println();}}}}
这道题目比较有代表性,recursive function是解题的关键 Question 6 Write a function has_path that takes in a tree t and a string word. It returns True if there is a path that starts from the root where the entries along the path spell out the word, …
ppch. 1.1-1.2HW01
PP
expressions:An expression describes a computation and evaluates to a value
call expressions: function call notation (函数调用表达式) nested expressions:嵌套表达式
Discussion Question1
f min
f max
g, h min, max
max g
max(f(2,g(…