var
k: Word;
begin
Read (k);
case k of
0: Write ('y = 1');
1, 2, 3: Write ('y = x');
4: Write ('y = 4x + 5');
5, 6, 7, 8, 9, 10: Write ('y = 2x - 1');
else Write ('y = 3x + 1');
end;
end.
x, y: real;
K: word;
writeln('Введите исходные данные:');
write('x= ');
read(x);
write('K= ');
read(K);
case K of
0: y := 1;
1..3: y := x;
4: y := 4 * x + 5;
5..10: y := 2 * x - 1;
else y := 3 * x + 1;
writeln('Ответ: y= ', y);
// проверено в PascalABC.NET 3.4.2, сборка 1837 от 12.10.2018
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
var
k: Word;
begin
Read (k);
case k of
0: Write ('y = 1');
1, 2, 3: Write ('y = x');
4: Write ('y = 4x + 5');
5, 6, 7, 8, 9, 10: Write ('y = 2x - 1');
else Write ('y = 3x + 1');
end;
end.
var
x, y: real;
K: word;
begin
writeln('Введите исходные данные:');
write('x= ');
read(x);
write('K= ');
read(K);
case K of
0: y := 1;
1..3: y := x;
4: y := 4 * x + 5;
5..10: y := 2 * x - 1;
else y := 3 * x + 1;
end;
writeln('Ответ: y= ', y);
end.
// проверено в PascalABC.NET 3.4.2, сборка 1837 от 12.10.2018