program CheckDigitOccurrences;
function CheckDigitOccurrences(n: int64; xtims: Integer; digit: Integer): Boolean;
var
count: Integer;
begin
count := 0;
// Count occurrences of the digit in the number
while n > 0 do
begin
if (n mod 10 = digit) then
Inc(count);
n := n div 10;
end;
// Return true if the count matches xtims
CheckDigitOccurrences := (count = xtims);
end;
begin
// Test the function with the given inputs
WriteLn(CheckDigitOccurrences(7097175, 3, 7));
WriteLn(CheckDigitOccurrences(70975, 3, 7));
end.
(*
run:
TRUE
FALSE
*)