{ VYTAH.PAS Copyright (c) Jan Benkovic } { Vypocet nosnosti vytahu. Zadas pocet ludi. } { } { Datum:12.03.2000 http://www.trsek.com } program vytah; uses crt; var nosnost,vaha,ludi,a,b : longint; begin clrscr; Write('Napis nosnost vytahu : '); Readln(nosnost); Write('Naspi pocet ludi, ktory sa budu viest : '); Readln(ludi); for a := 1 to ludi do begin Write('Naspis vahu ',a,' cloveka : '); Readln(vaha); b:=b+vaha; end; if b < nosnost then Writeln('Vytah nespadne') else if b=nosnost then Writeln('Vyjde to akurat') else Writeln('Vytah spadne'); readkey; end.