Advertisement
veto14

tuamaemecagando.java

Sep 11th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. package aa;
  2. import java.util.Scanner;
  3.  
  4. public class diarreia {
  5. public static void main (String []args) {
  6. int m,n;
  7. Scanner sc = new Scanner(System.in);
  8. System.out.println("Digite o numero de linhas, seguido do numero de colunas da sua matriz");
  9. m = sc.nextInt();
  10. n = sc.nextInt();
  11. int[][] mat = new int[m][n];
  12. sc.close();
  13. for(int i=0; i<m; i++) {
  14. for(int j=0; j<n; j++) {
  15. mat[i][j] = i*j;
  16. System.out.println("Linha:" + i + " Coluna:" + j + " = " + mat[i][j]);
  17. }
  18. System.out.println(" ");
  19. }
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement