fork download
  1. with Ada.Text_IO, Ada.Integer_Text_IO;
  2. use Ada.Text_Io, Ada.Integer_Text_IO;
  3. procedure Matrix_mul is
  4. i,j,k: Integer;
  5. mat_res: array(0..2,0..2) of Integer:=((0,0,0),(0,0,0),(0,0,0));
  6. mat_a:array(0..2,0..2) of Integer:=((1,1,1),(1,1,1),(1,1,1));
  7. mat_b:array(0..2,0..2) of Integer:=((2,2,2),(2,2,2),(2,2,2));
  8. begin
  9. for i in 0..2 loop
  10. for j in 0..2 loop
  11. for k in 0..2 loop
  12. mat_res(i)(j) := (mat_res(i)(j) + (mat_a(i)(k)* mat_b(k)(j)));
  13. end loop;
  14. put(mat_res(i)(j),2);
  15.  
  16. end loop;
  17.  
  18. end loop;
  19.  
  20. end Matrix_mul;
  21.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
gnatgcc -c -pipe -O2 prog.adb
prog.adb:3:11: warning: file name does not match unit name, should be "matrix_mul.adb"
prog.adb:12:17: too few subscripts in array reference
prog.adb:12:35: too few subscripts in array reference
prog.adb:12:50: too few subscripts in array reference
prog.adb:12:63: too few subscripts in array reference
prog.adb:14:15: too few subscripts in array reference
gnatmake: "prog.adb" compilation error
stdout
Standard output is empty