Ricky96
03-05-2012, 18:42
Ciao ragazzi! E' la prima volta che scrivo su questo forum.. A scuola sto studiando programmazione su Pascal. Vi chiedo un aiuto per questo programma Pascal. Mi da un errore strano.. Ho provato a risolverlo in vari modi ma non funzionano.
Ecco il programma:
Program randomize;
uses crt;
var vet:array[1..100] of integer;
n,somma:integer;
Begin
writeln('Introduci un numero compreso tra 0 e 100');
readln(n);
Randomize;
for i:=1 to n do
begin
vet[i]:=random(150)+1;
writeln(vet[i]);
end;
For i:=1 TO n do
Begin
If vet[i]>120
Then
Somma:=somma+vet[i];
end;
Writeln(somma);
readln;
end.
L'errore che mi da è il seguente: Fatal: Syntax error, . expected but ; found
Grazie a tutti in anticipo:)
Ecco il programma:
Program randomize;
uses crt;
var vet:array[1..100] of integer;
n,somma:integer;
Begin
writeln('Introduci un numero compreso tra 0 e 100');
readln(n);
Randomize;
for i:=1 to n do
begin
vet[i]:=random(150)+1;
writeln(vet[i]);
end;
For i:=1 TO n do
Begin
If vet[i]>120
Then
Somma:=somma+vet[i];
end;
Writeln(somma);
readln;
end.
L'errore che mi da è il seguente: Fatal: Syntax error, . expected but ; found
Grazie a tutti in anticipo:)