1) A⇒B⇒C⇒D⇒E⇒F 1+2+1+2+1=7 ответ 7
2) A⇒C⇒D⇒E 3+4+1=8 ответ 8
3) A⇒C⇒D⇒E 3+6+1=10 ответ 10
2)
var a,b,c,x,y,z,s:real;
begin
writeln('Введите стоимость 1 кг конфет, печенья и яблок:');
readln(a,b,c);
writeln('Введите вес конфет, печенья и яблок:');
readln(x,y,z);
s:=a*x+b*y+c*z;
writeln('Стоимость всей покупки = ',s);
end.
Пример:
Введите стоимость 1 кг конфет, печенья и яблок:
215 150 60
Введите вес конфет, печенья и яблок:
0.5 2 3.5
Стоимость всей покупки = 617.5
3)
var b,s:real;
begin
write('b = ');
readln(b);
s:=b*30/1.5;
writeln('s = ',s);
end.
Пример:
b = 2
s = 40
640 * 480 = 307200 пикс.
307200 * 3 = 921600 байт
28800 бит/c = 3600 байт/c
921600 / 3600 = 256 c.
{
Если что, часть программы не нужна для построения цепочки. Она просто иллюстрирует, что полученный результат верен.
}
var
sq : array[0..999] of array[0..9] of boolean;
co : array[0..999] of integer;
ar : array[1..10003] of 0..9;
i,j: integer;
x: integer;
t : boolean;
begin
for i := 0 to 999 do
begin
for j := 0 to 9 do
sq[i][j] := false;
co[i] := 0;
end;
for i := 1 to 3 do
ar[i] := 0;
i := 3;
t := true;
{write('000');}
while t do
begin
i := i + 1;
x := ar[i-3]*100 + ar[i-2]*10 + ar[i-1];
if co[x] >= 10 then t := false
else
begin
j := 1;
while sq[x][j] do
j := (j + 1) mod 10;
ar[i] := j;
sq[x][j] := true;
co[x] := co[x] + 1;
{write(j)}
end;
end;
{writeln;}
writeln('Length: ',i - 1);
{просто чтобы убедиться}
for i := 0 to 999 do
for j := 0 to 9 do
sq[i][j] := false;
t := true;
j := 0;
i := 1;
while (i <= 10000) and t do
begin
x := ar[i] * 100 + ar[i+1] * 10 + ar[i+2];
if sq[x][ar[i+3]] then t := false
else
begin
sq[x][ar[i+3]] := true;
j := j + 1;
end;
i := i + 1
end;
if t and (j = 10000) then
write('Confirmed')
<span>end.</span>
Unit proect;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, TAGraph, TASeries,Forms,
Controls, Graphics, Dialogs, StdCtrls, ExtCtrls;
type
{ TForm1 }
TForm1 = class(TForm)
Button1: TButton;
Chart1: TChart;
Image5: TImage;
Image6: TImage;
Label14: TLabel;
Label15: TLabel;
SinSeries2: TLineSeries;
CosSeries2: TLineSeries;
Edit3: TEdit;
Edit4: TEdit;
Edit1: TEdit;
Edit2: TEdit;
Image1: TImage;
Image2: TImage;
Image3: TImage;
Image4: TImage;
Label1: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
Label13: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Shape1: TShape;
SinSeries: TLineSeries;
CosSeries: TLineSeries;
SinCosSeries: TLineSeries;
procedure Button1Click(Sender: TObject);
private
{ private declarations }
public
{ public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure TForm1.Button1Click(Sender: TObject);
const
N = 100;
MIN = -5;
MAX = 5;
var
x, step: Double;
a, b, c, d, i: Integer;
begin
//чистка предыдущих графиков
//считываем переменные
a := StrToInt(Edit1.Text);
b := StrToInt(Edit2.Text);
c := StrToInt(Edit3.Text);
d := StrToInt(Edit4.Text);
step := (MAX - MIN) / N;
x := MIN;
repeat
//Рисуем графики
SinSeries.AddXY(x, a * x + b);
CosSeries.AddXY(x, d * x * x);
SinCosSeries.AddXY(x, c / x);
SinSeries2.AddXY(x, sin(x));
CosSeries2.AddXY(x, cos(x));
//следующий
x := x + step;
until x > MAX;
end;
end.