Egor_Vakar

lab2(delphi)

Sep 9th, 2021 (edited)
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 0.82 KB | None | 0 0
  1. program lab2;
  2. {$APPTYPE CONSOLE}
  3. {$R *.res}
  4. uses
  5.   System.SysUtils;
  6. var
  7.     Weight, Price, TotalPrice: Integer;
  8. begin
  9.     Writeln('Таблица цены сыра:' + #13#10 + ' ________________' + #13#10 +
  10.             '|цена  |стоимость|' + #13#10 + '|______|_________|');
  11.     Weight := 50;
  12.     Price := 280;
  13.     repeat
  14.         TotalPrice := Weight * Price div 1000;
  15.         Write ('|', Weight, 'г');
  16.         if Weight < 100 then
  17.             Writeln('   |', TotalPrice, 'р      |')
  18.         else
  19.             if Weight < 400 then
  20.                 Writeln('  |', TotalPrice,  'р      |')
  21.             else
  22.                 if Weight < 1000 then
  23.                     Writeln('  |', TotalPrice, 'р     |')
  24.                 else
  25.                     Writeln(' |', TotalPrice, 'р     |');
  26.         Writeln('|______|_________|');
  27.         Weight := Weight + 50;
  28.     until Weight > 1000;
  29.     Readln;
  30. end.
Add Comment
Please, Sign In to add comment