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 izapr_cv07;
- import java.util.Locale;
- /**
- *
- * @author st55431
- */
- public class Izapr_cv07 {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- Matice m = null;
- Matice m2;
- int a = 5;
- int b = 5;
- m = new Matice(a, b);
- m2 = new Matice();
- m.napln(1, 2);
- System.out.println(m.toString("%4.1f "));
- System.out.println("");
- System.out.println(m.toString());
- System.out.println("");
- System.out.println(m2.toString());
- System.out.println("Diagonála");
- double[] diagonala = m.diagonala();
- for (int i = 0; i < diagonala.length; i++) {
- System.out.printf(Locale.ENGLISH, "%4.1f ", diagonala[i]);
- }
- System.out.println("\nNad hlavní");
- Matice mt = m.horniNadHlavniDiagonalou();
- System.out.println("\n" + mt.toString("%4.1f "));
- System.out.println("Pod hlavní");
- Matice mp = m.dolniPodHlavniDiagonalou();
- System.out.println("\n" + mp.toString("%4.1f "));
- System.out.println("Vedlejší diagonála"); //Nejde
- double[] vedlejsiDiagonala = m.vedlejsiDiagonala();
- for (int i = 0; i < vedlejsiDiagonala.length; i++) {
- System.out.printf(Locale.ENGLISH, "%4.1f ", vedlejsiDiagonala[i]);
- }
- System.out.println("\nNad vedlejsi"); //Nejde
- Matice ms = m.horniNadVedlejsiDiagonalou();
- System.out.println("\n" + mt.toString("%4.1f "));
- System.out.println("Pod vedlejsi"); //Nejde
- Matice mr = m.dolniPodVedlejsiDiagonalou();
- System.out.println("\n" + mp.toString("%4.1f "));
- //Najdi MAX a MIN Prvek.
- }
- }
Add Comment
Please, Sign In to add comment