var n, c, i, x: integer;
begin
readln(n);
c := 0;
for i := 1 to n do
readln(x);
if ((x >= 100) and (x <= 999) and (x div 100 = 3) and (x mod 5 = 0)) then c := c + 1;
writeln(c);
end.
它必须从长度为 n 的序列中找到以 3 开头且可被 5 整除的三位数字的个数。
var n, c, i, x: integer;
begin
readln(n);
c := 0;
for i := 1 to n do
readln(x);
if ((x >= 100) and (x <= 999) and (x div 100 = 3) and (x mod 5 = 0)) then c := c + 1;
writeln(c);
end.
它必须从长度为 n 的序列中找到以 3 开头且可被 5 整除的三位数字的个数。
被诅咒的一天,有人突然想到用缩进控制程序逻辑会很好。
帕斯卡不是 Python。所以为了
readln和一起if运行,它们需要放在begin和之间endReadSeqInteger(ReadInteger).Where(x -> (x in (100..999)) and (x div 100 = 3) and x.Divs(5)).Count.Print