小编Wid*_*oud的帖子

如何在Pascal中使用具有不同数据类型的多个参数来实现功能?

我已经用两个具有相同数据类型的参数制作了一个函数,对此我没有任何问题。

但是我在使用不同的数据类型时遇到了麻烦

这是我的代码:

uses crt;
function inputscore(name : string, score:integer) : integer;

begin
     writeln('My name is ',name,' and my score is ',score);
     inputscore:=0;
end;

begin
    clrscr;

    inputscore('David',98);
    readkey;
end.
Run Code Online (Sandbox Code Playgroud)

但是它返回了此错误消息:

multipleparameterfunc.pas(2,34)Fatal syntax error, ")" expected but "," found

pascal freepascal

0
推荐指数
1
解决办法
1894
查看次数

标签 统计

freepascal ×1

pascal ×1