Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class cos {
- public static void main(String[] args) {
- int G[][] = new int[10][10];
- int GG[][] = new int[10][10];
- int F[][] = new int[10][10];
- System.out.println("\nMatrix 1\n----------------------------");
- int n = 0;
- for(int i = 0; i < 10; i++)
- {
- for(int j = 0; j < G[i].length; j++)
- {
- G[i][j] = j + n;
- n = 1;
- System.out.print(G[i][j] + " ");
- }
- System.out.println();
- }
- System.out.println("\nMatrix2\n----------------------------");
- for(int i = 0; i < GG.length; i++)
- {
- for(int j = 0; j < GG[i].length; j++)
- {
- GG[i][j] = i + 1;
- System.out.print(GG[i][j] + " ");
- }
- System.out.println();
- }
- System.out.println("\nTo co wyszlo\n----------------------------");
- for(int row = 0; row < F.length; row++)
- {
- for(int column = 0; column < F[row].length; column++)
- {
- // Addition
- F[row][column] = GG[row][column] +
- G[row][column];
- System.out.print(F[row][column] + " ");
- }
- System.out.println();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement