主题:tju的一些问题
tju1014:program tju1014;
var n,a,b:longint;
m:integer;
begin
while not seekeof do
begin
read(n);
m:=0;
for a:=5 to n do
begin
b:=a;
while (b mod 5=0) do
begin
b:=b div 5;
m:=m+1;
end;
end;
writeln(m);
end;
end.
tju1044:
program tj1044;
var a,n,b,d:longint;
c:boolean;
begin
readln(n);
for a:=1 to maxlongint do
begin
if a>=7
then if a mod 7<>0
then begin
b:=a;
c:=false;
repeat
d:=b mod 10;
b:=b div 10;
if d=7
then c:=true;
until (c) or (b=0);
if c
then begin
writeln(a);
n:=n-1;
end;
end
else begin
writeln(a);
n:=n-1;
end;
if n=0
then exit;
end;
end.
这两道题都wa!!!!!
不知该怎么改???
一道+20
var n,a,b:longint;
m:integer;
begin
while not seekeof do
begin
read(n);
m:=0;
for a:=5 to n do
begin
b:=a;
while (b mod 5=0) do
begin
b:=b div 5;
m:=m+1;
end;
end;
writeln(m);
end;
end.
tju1044:
program tj1044;
var a,n,b,d:longint;
c:boolean;
begin
readln(n);
for a:=1 to maxlongint do
begin
if a>=7
then if a mod 7<>0
then begin
b:=a;
c:=false;
repeat
d:=b mod 10;
b:=b div 10;
if d=7
then c:=true;
until (c) or (b=0);
if c
then begin
writeln(a);
n:=n-1;
end;
end
else begin
writeln(a);
n:=n-1;
end;
if n=0
then exit;
end;
end.
这两道题都wa!!!!!
不知该怎么改???
一道+20