|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Junior Member
Iscritto dal: May 2012
Messaggi: 9
|
[Pascal] Aiuto programma Pascal - RISOLTO
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 Ultima modifica di Ricky96 : 03-05-2012 alle 19:20. |
|
|
|
|
|
#2 |
|
Junior Member
Iscritto dal: May 2012
Messaggi: 9
|
Ho risolto da solo in questo modo.
Program randomize; uses crt; var vet:array[1..100]of integer; i,n,somma:integer; Begin somma:=0; writeln('Introduci un numero compreso tra 0 e 100'); readln(n); for i:=1 to n do begin Randomize. 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('Ecco la somma dei numeri: ',somma); readln; end. |
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 08:23.



















