Wpis z mikrobloga

program Project1;

var
tab:array[0..2,0..2,0..2] of integer;

begin

tab[0,0]:=1;
tab[0,1]:=3;
tab[0,2]:=5;
tab[1,0]:=sqr(tab[0,0]);
tab[1,1]:=sqr(tab[0,1]);
tab[1,2]:=sqr(tab[0,2]);
tab[2,0]:=sqrt(tab[0,0]);
tab[2,1]:=sqrt(tab[0,1]);
tab[2,2]:=sqrt(tab[0,2]);
writeln(tab[0,0],tab[0,1],tab[0,2],tab[1,0],tab[1,1],tab[1,2],tab[2,0],tab[2,1],tab[2,2]);
readln;

end.

Dopiero zaczynam Pascala i przy robieniu prostej tabeli przy bardziej rozbudowanej w wiersze wyskakują błędy
Compile Project, Target: C:\Users\VeB\AppData\Local\Temp\project1.exe: Exit code 1, Errors: 10
project1.lpr(9,11) Error: Incompatible types: got "ShortInt" expected "Array[0..2] Of LongInt"
project1.lpr(10,11) Error: Incompatible types: got "ShortInt" expected "Array[0..2] Of LongInt"
project1.lpr(11,11) Error: Incompatible types: got "ShortInt" expected "Array[0..2] Of LongInt"
project1.lpr(12,23) Error: Incompatible type for arg no. 1: Got "Array[0..2] Of LongInt", expected "Double"
project1.lpr(13,23) Error: Incompatible type for arg no. 1: Got "Array[0..2] Of LongInt", expected "Double"
project1.lpr(14,23) Error: Incompatible type for arg no. 1: Got "Array[0..2] Of LongInt", expected "Double"
project1.lpr(15,24) Error: Incompatible type for arg no. 1: Got "Array[0..2] Of LongInt", expected "Double"
project1.lpr(16,24) Error: Incompatible type for arg no. 1: Got "Array[0..2] Of LongInt", expected "Double"
project1.lpr(17,24) Error: Incompatible type for arg no. 1: Got "Array[0..2] Of LongInt", expected "Double"
project1.lpr(18,17) Error: Can't read or write variables of this type

Pomoze ktos? #programowanie #programowanie15k #pascal #informatyka
  • 18
  • Odpowiedz
  • Otrzymuj powiadomienia
    o nowych komentarzach

@export: znów zgaduję. Najprawdopodobniej tablica inicjowana jest zerami. Twój przykład wypisuje elementy zainicjowanej tablicy - czyli zera.
  • Odpowiedz