Объяснение:
procedure colors();
var number: integer; //Номер цвета
mess: string; //Сообщение, которое будем выводить
begin
{Считывание значения}
write('Input number (1-4): ');
readln(number);
writeln();
mess:='';
case number of
1: mess := 'Color is white';
2: mess := 'Color is gray';
3: mess := 'Color is red';
4: mess := 'Color is blue';
else
mess := 'There is no such color';
end;
writeln(mess);
readln(); // удерживаем консоль
// Вызов процедуры
colors();
end.
Поделитесь своими знаниями, ответьте на вопрос:
Дано целое число в диапазоне 1-4 : номер цвета. Вывести название цвета : 1- белый, 2- серый, 3-красный 4 - синий Паскаль )
Объяснение:
procedure colors();
var number: integer; //Номер цвета
mess: string; //Сообщение, которое будем выводить
begin
{Считывание значения}
write('Input number (1-4): ');
readln(number);
writeln();
mess:='';
case number of
1: mess := 'Color is white';
2: mess := 'Color is gray';
3: mess := 'Color is red';
4: mess := 'Color is blue';
else
mess := 'There is no such color';
end;
writeln(mess);
readln(); // удерживаем консоль
end;
begin
// Вызов процедуры
colors();
end.