Calculate lifting capacity
Delphi & Pascal (česká wiki)
Category: KMP (Club of young programmers)
Author: Ján Benkovič
web: www.tbteacher.host.sk
Program: Vytah.pas
Author: Ján Benkovič
web: www.tbteacher.host.sk
Program: Vytah.pas
Calculate lifting capacity. Input number of people who enter.
{ 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.