CanonSharp/OpenSet/36_scope.pas
jackfiled 89ce313b77 feat: CanonSharp Benchmark. (#4)
Reviewed-on: https://git.bupt-hpc.cn/jackfiled/CanonSharp/pulls/4
Co-authored-by: jackfiled <xcrenchangjun@outlook.com>
Co-committed-by: jackfiled <xcrenchangjun@outlook.com>
2024-08-19 14:37:34 +08:00

29 lines
341 B
ObjectPascal

program main;
var a, sum, i: integer;
function func: integer;
var b,a: integer;
begin
b := 7;
a := 1;
if (a = b) then
begin
a := a + 1;
func := 1;
end
else
func := 0;
end;
begin
a := 7;
sum := 0;
for i := 0 to 99 do
begin
if (func() = 1) then
sum := sum + 1;
end;
write(a);
write(sum);
end.