finished doing lab2 in wrong variable type
This commit is contained in:
parent
00fba12eb2
commit
3f15c4c724
|
@ -65,8 +65,21 @@ public class Main {
|
|||
}
|
||||
}
|
||||
|
||||
int[][] matrix = loadMatrixFromFile(matrix_file);
|
||||
// loading matrix data from file
|
||||
int[][] raw_m = loadMatrixFromFile(matrix_file);
|
||||
|
||||
// creating original matrix object
|
||||
System.out.println("Original matrix:");
|
||||
Matrix m = new Matrix();
|
||||
m.init(raw_m);
|
||||
|
||||
// transposing
|
||||
m.transpose();
|
||||
System.out.println("\nTransposed matrix:");
|
||||
m.print();
|
||||
|
||||
// avg
|
||||
System.out.println("\nAverage value is " + m.getAvg());
|
||||
}
|
||||
|
||||
private static void fetchResource(String remote_url, String output_filename) {
|
||||
|
@ -138,11 +151,11 @@ public class Main {
|
|||
}
|
||||
|
||||
for (int j = 0; j < baked_matrix_lines.get(i).length; j++) {
|
||||
System.out.print(baked_matrix_lines.get(i)[j] + " ");
|
||||
//System.out.print(baked_matrix_lines.get(i)[j] + " ");
|
||||
baked_matrix[i][j] = Integer.parseInt(baked_matrix_lines.get(i)[j]);
|
||||
}
|
||||
|
||||
System.out.print("\n");
|
||||
//System.out.print("\n");
|
||||
}
|
||||
|
||||
return baked_matrix;
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
import random
|
||||
print("Content-Type: text/plain\n\n" + "\n".join([" ".join(list(map(str, [round((random.random()-0.5)*200, 4) for i in range(7)]))) for i in range(7)]))
|
Loading…
Reference in New Issue