Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/58.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Loops 如何修复for循环中的错误。帕斯卡_Loops_For Loop_If Statement_Pascal - Fatal编程技术网

Loops 如何修复for循环中的错误。帕斯卡

Loops 如何修复for循环中的错误。帕斯卡,loops,for-loop,if-statement,pascal,Loops,For Loop,If Statement,Pascal,我写了一个程序,但有一个错误,我不能理解 错误:main.pas(23,11)致命:语法错误,应为“)”但找到“序数常量” 程序你好 x%5=0是错误 您可能需要使用模运算符 %是c和其他语言中的模运算符。在pascal中,模运算符是mod 正确的说法是: if (x mod 5 = 0) then WriteLn(x); x%5=0是错误。您可能需要使用模运算符%是c和其他语言中的模运算符。在pascal中,模运算符是mod。也就是说,xmod5=0@LURD谢谢,成功了。你可以写在答案里

我写了一个程序,但有一个错误,我不能理解

错误:main.pas(23,11)致命:语法错误,应为“)”但找到“序数常量”


程序你好 
x%5=0
是错误

您可能需要使用模运算符

%
是c和其他语言中的模运算符。在pascal中,模运算符是
mod

正确的说法是:

if (x mod 5 = 0) then WriteLn(x);

x%5=0
是错误。您可能需要使用模运算符
%
是c和其他语言中的模运算符。在pascal中,模运算符是
mod
。也就是说,
xmod5=0
@LURD谢谢,成功了。你可以写在答案里
if (x mod 5 = 0) then WriteLn(x);