Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- program a;
- type Ora=0..23;
- Grade=-40..+40;
- Temperatura=array[Ora] of Grade;
- //1
- procedure pro(temp:Temperatura);
- var
- min,max:Grade;
- i:Ora;
- f:Text;
- begin
- min:=high(Grade); max:=low(Grade);
- for i:=low(Ora) to high(Ora) do
- begin
- if temp[i]>max then max:=temp[i];
- if temp[i]<min then min:=temp[i];
- end;
- writeln('minim=',min,' maxim=',max);
- //2
- for i:=low(Ora) to high(Ora) do
- if (temp[i]=max) then writeln('la ora ',i,' s-a inregistrat maximul ',max);
- //3
- assign(f,'fisier.txt');
- rewrite(f);
- for i:=low(Ora) to high(Ora) do
- if (temp[i]=min) then writeln(f,'la ora ',i,' s-a inregistrat minimul ',min);
- close(f);
- end;
- var temp:Temperatura;
- begin
- temp[0]:=4;
- temp[1]:=-6;
- temp[5]:=4;
- temp[8]:=4;
- temp[10]:=-6;
- temp[12]:=-6;
- temp[11]:=3;
- pro(temp);
- end.
Add Comment
Please, Sign In to add comment