answer Pascal (грузовики)

program answer; const MASS = 100; var sum_mas: integer := 0; load: integer := 0; count_auto: integer := 0; begin while (sum_mas < MASS) DO begin writeln('Введите вес груза прибывшей машины (в т.):'); read(load); if sum_mas + load > MASS then writeln('Если разгрузить эту машину, то склад будет переполнен на ', -(MASS - sum_mas - load), ' т.') else Inc(count_auto); sum_mas := sum_mas + load; end; writeln('Число полностью разгруженных машин: ', count_auto); end.

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.