Thứ Ba, 3 tháng 5, 2022

CHUSO0 Pascal

var    n,res,x,i:longint;

function dem(x:longint):longint;
var d:longint;
begin
    d:=0;
    while x mod 5=0 do
    begin
        x:=x div 5;
        inc(d);
    end;
    exit(d);
end;

begin
    assign(input,'chuso0.inp');reset(input);
    assign(output,'chuso0.out');rewrite(output);
    readln(n);
    res:=0;
    for i:=1 to n do         
        res:=res+dem(i);         
    writeln(res);
end.

Không có nhận xét nào:

Đăng nhận xét

Lưu ý: Chỉ thành viên của blog này mới được đăng nhận xét.