所以我正在使用pascal,我想在一个案例中添加多个语句。我尝试了此代码,但出现错误:"错误:常量和 CASE 类型不匹配">
procedure pay;
begin
loop:=loop+1;
CASE loop OF
1:
writeln('E-Mail: ');
readln(mailO[1]);
writeln('amount: ');
readln(amount[1]);
end;
将
复合语句包装在begin
和end
中:
procedure pay;
begin
loop:=loop+1;
CASE loop OF
1:
begin
writeln('E-Mail: ');
readln(mailO[1]);
writeln('amount: ');
readln(amount[1]);
end;
2: writeln('simple statement');
3: begin
writeln('something else');
writeln('etc.');
end;
end;
end;