Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - The number of all integers in Pascal 1~N that are divisible by 5 and have at least one digit of 5.
The number of all integers in Pascal 1~N that are divisible by 5 and have at least one digit of 5.
Function isOk(n: integer): boolean

defined variable

I: integer;

begin

Results: = pos('5', inttostr (n)) > 0;

End;

Function myfunc (n: integer): integer;

defined variable

I: integer;

begin

Results: = 0;

For i := 1 to n do

begin

If (i mod 5 = 0) and isok(i), then

Inc (result);

End;

End;