procedure questiontype;
begin
writeln ('Enter the type of question you would like...');
writeln ('1. Add');
writeln ('2. Multiply');
writeln ('3. Subtraction');
writeln ('4. Division');
readln (typeofquestion);
case typeofquestion of
1: add;
2: multiply;
3: subraction;
4: division
else writeln ('Choose again');
end;
end;
加、乘、减和除法都是过程。如果我将它们放在主程序中,它们将正常运行,但当我将它们作为单独的过程时,我会收到“未声明的标识符”错误。我已经查看了许多网站,寻找类似于此的示例,但我找不到任何内容。
如何从这个程序内部调用加、乘、减、除法过程?
case
语句吗? - Andreas Rejbrand