Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
- package tablice2d2t;
- /**
- *
- * @author uczen
- */
- public class Tablice2d2t {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- // Definicja i deklaracja tablic 2D
- //Dynamicznie:
- //typ[][] nazwa Tablicy = new typ[liczbaWierszy][liczbaKolumn];
- String[][] sp = new String[5][12];
- double [][]tpensji = new double[12][2];
- double[][]gps = new double[36][2];
- //uzupelnienie losowe
- for (int i = 0; i < 36; i++)//wiersze
- {
- for (int j = 0; j < 2; j++)//kolumny
- {
- gps[i][j]=Math.random()*500;
- }
- }
- //wyśweitlanie
- System.out.println("x\ty");
- for (int i = 0; i < 36; i++) {
- System.out.println(gps[i][0]+"\t"+gps[i][1]);
- }
- //tablice 2D statycznie
- String []imie={"Zosia","Czesia","Gabrysia"};
- String [][]tunlike={
- {"Skoła", "ttruskawki","meny","kawa"},
- {"pączki", "smietana","pań","aut"},
- {"psów","kotów","jaszczurów","żubrów"}
- };
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement