Defines the highest temperature of a week
Delphi & Pascal (česká wiki)
Category: Homework in Pascal
Program: Teploty.pas
Program: Teploty.pas
Defines the highest temperature of a week.
{ TEPLOTY.PAS Copyright (c) TrSek alias Zdeno Sekerak } { Urci najvysiu teplotu v tyzdni } { Vstup : teploty jednotlivych dni v tyzdni } { Vystup: najvyssia teplota v tyzdni } { } { Datum:10.04.2000 http://www.trsek.com } program teploty (input, output); var dni : array[1..7] of real; i,den : integer; max : real; begin den := 0; for i := 1 to 7 do begin writeln ('Zadaj teplotu v ',i,' dni: '); read (dni[i]); end; max := 0; for i := 1 to 7 do begin if (max < dni[i]) then begin max := dni[i]; den := i; end end; writeln ('Najvyssia teplota (',max:3:1,' C) bola v ',den,' dni tyzdna'); ReadLn; end.