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. matrix_res: array(0..2,0..2) of Integers:=((0,0,0),(0,0,0),(0,0,0));
  6. matrix_a:array(0..2,0..2) of Integers:=((1,1,1),(1,1,1),(1,1,1));
  7. matrix_b:array(0..2,0..2) of Integers:=((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. matrix_res(i)(j) +:= matrix_a(i)(k)* matrix_b(k)(j);
  13. end loop;
  14. end loop;
  15. end loop;
  16. put(matrix_res,2);
  17.  
  18. end Matrix_mul;
  19.  
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:5:33: "Integers" is undefined (more references follow)
prog.adb:5:33: possible misspelling of "Integer"
prog.adb:12:25: missing ";"
prog.adb:16:01: no candidate interpretations match the actuals:
prog.adb:16:01: too many arguments in call to "put"
prog.adb:16:05: expected type "Standard.String"
prog.adb:16:05: found type of matrix_res declared at line 5
prog.adb:16:05:   ==> in call to "Put" at a-tiinio.ads:77, instance at a-inteio.ads:18
prog.adb:16:05:   ==> in call to "Put" at a-tiinio.ads:67, instance at a-inteio.ads:18
prog.adb:16:05:   ==> in call to "Put" at a-tiinio.ads:61, instance at a-inteio.ads:18
prog.adb:16:05:   ==> in call to "Put" at a-textio.ads:243
prog.adb:16:05:   ==> in call to "Put" at a-textio.ads:209
gnatmake: "prog.adb" compilation error
stdout
Standard output is empty