Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.lang.Math;
- import java.io.*;
- class Matrix {
- public static void main(String args[]) {
- BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
- int n, m, i, j;
- int[][] A;
- System.out.print("Please, enter number of the lines... ");
- n = (int) br.read();
- System.out.print("Please, enter number of the coloumns... ");
- m = (int) br.read();
- for (i=0 ; i<n ; i++) {
- for (j=0 ; j<m ; j++) {
- int a = Math.pow(i, 3) + Math.pow(j, 2);
- int A[i][j] = int a;
- System.out.print(A[i][j] + " ");
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement