[r]
(1)GIẢI ĐỀ THI GVDG CẤP HUYỆN 2017 1 Trắc nghiệm
Câu 1: B Câu 2: C Câu 3: C Câu 4: A Câu 5: D 2 Tự luận Bài 1: var s,x:real; n,i,j,gt:word; Begin
write('Nhap x = ');readln(x); write('Nhap n = ');readln(n); s:=1;
for i:=1 to n begin
gt:=1;
for j:=1 to i gt:=gt*j; s:=s+x/gt;
end;
writeln('Tong S = ',s:0:4); readln;
end Bài 2: var s:real; n,i:word; Begin
write('Nhap n = ');readln(n); s:=1;
for i:=2 to n s:=sqrt(s+sqrt(i)); writeln('Tong S = ',s:0:4);
readln; end Bài 3:
var i,j,k,t,d:word; begin
d:=1;
(2)if 10*i+20*j+50*k = 100 then begin
write('Cach ',d,': ');
if i<>0 then write(i:3,' to 10 dong '); if j<>0 then write(j:3,' to 20 dong '); if k<>0 then write(k:3,' to 50 dong '); inc(d);
writeln; end; readln; end Bài 4:
var f1,f2:text; N,i,j,d:word;
a:array[1 1000] of byte; Begin
assign(f1,'d:\nhiphan.inp'); reset(f1);
assign(f2,'d:\nhiphan.out'); rewrite(f2);
read(f1,n); i:=1;
while n<>0 Begin
d:=n mod 2; n:=n div 2; a[i]:=d; inc(i); end;
for j:=i-1 downto write(f2,a[j]); readln;
close(f1);close(f2); end
Bài 5:
var f1,f2:text; m,n,bc,d:word; begin
assign(f1,'d:\boi.inp'); reset(f1);
assign(f2,'d:\boi.out'); rewrite(f2);
(3)bc:=m*n; d:=n mod m; while d<>0 Begin
d:=m mod n; m:=n;
n:=d; end;
writeln(f2,bc div m); readln;
close(f1);close(f2); end