1. Trang chủ
  2. » Giáo Dục - Đào Tạo

Đề thi học sinh giỏi lớp 9 THCS tỉnh Ninh Bình năm 2012 - 2013 môn Tin học

5 284 0

Đang tải... (xem toàn văn)

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 5
Dung lượng 106,5 KB

Nội dung

   !"  Đề thi gồm 03 câu, trong 02 trang #$%&%'()%*)" * Các file chương trình và file dữ liệu được đặt tên chính xác như sau: $+, /.01, 0- 20.3%4-5 20.3%67 .1  !""#! SNT.PAS SNT.INP SNT.OUT 2s $%&'()*+  DIV.PAS DIV.INP DIV.OUT 2s ,-)" SQUARE.PAS SQUARE.INP SQUARE.OUT 2s  "89.$%+:%;$+)8. /0<= 123(4"'#05673"'8'9:'  08 "#! 1 ;#<)93=':  !""#! '&#<(>? !""#!: "#!@ A#B '-''> !C'DE9F'&1)G "#!?$,,,  !""#!)9$,,,: "#!)$,,$,$'H'-' "#!? 20.3%4-5"<IJ: "#!K3(n L M  20.3%67"<>?NO"N !""#!-%P3='1-%P @ABC"  <6DE.4F.,+:98 ./0@<= I:+ Q "#!K3(7 3=')O%!:?RS# '<+ #"1T 'U'-'FV%'-'1 W"? Dữ liệu vào: @< XY&F"nn L XY&O0 "#!K3(a 1 , a 2 , , a n '-' W%!:K&'-'"Z:KT"'-'  L Dữ liệu ra: @<>? [\ 1'F'? Ví dụ: @< @<>? .G.)A . $]$$$ , ^1 ^1$$X]X$_ ^1,X$XX$_ %`$ ^aRbIRcNRRdI  N?bNeN?fg$,,, N?bNeN?fg,  N?bNeN?fg$,,, N?bNeN?fg, HI   H  I     " )5J+K4%K+:h/0L?=MN<= I:C'>iQjQ%!7'E ?I-'%!'A:k':':'E3=')*" Z:1l'Em'3*'W?%!7'E"Tn1 lW'-'"%!7':'E"Tn1 llJ'-'"?o09K3* 2*C%!'E,7?I-'1l' 1!$)"?^CC3KACPpC:7+: KqC'-'1lWC"Kq'-'1llJ? %'-'C KqC'E1l!O KqC 'E1l!O? Yêu cầu: ri%9O 3='-')"'1'E:KW1Z'-' 1'E%!CS'? Dữ liệu vào:L?=MN< XY&F"!Q$ "#!K3(F3=L?R  '-'":C%<? XK&O0KqC'-'1lW3CCZ F%!?R "'-'":C%<? XnK&O0KqC'-'1llJ3CK8'C ZF%!?R "'-'":C%<? Dữ liệu ra :L?=MN<>? X3=)"'E:K'1W? Ví dụ: L?=MN< L?=MN<>? 3 5       nnnnnRsnnnnn R8)!m ???????????????????????????????????????????????????????-K????????????????????????????? R8)!'>B[-P???????????????????????????????????????????????????????????????????????????????????????? R8)!'>B[-P$???????????????????????????????????????????????????????????????????????????????????????? %$`$ NY8' 1 0 1 0 1 0 0 0 1 1 1 1 1 1 1 0 0 1 1 0 0 0    !".+ (Hướng dẫn chấm gồm 03 trang) <OP? IT;:WFtuu$)*'-':0 'E v%!wIY? <QQ@R=S <T%)6U,V)19)4-)7+:W.X  19) .X   [Q]:0 7:?? .   [Q]:0 7:?? .   [Q]:0 7:?$? h <JYJ+  nnnnnnnnnnnROnnnnnnnnnnn Bài 1: Const fi = 'SNT.INP'; Fo = 'SNT.OUT'; var n: longint; f:text; kq: boolean; function nt(n: longint):boolean; var i: longint; begin if n<2 then exit(false); if n=2 then exit(true); for i:=2 to trunc(sqrt(n)) do if n mod i = 0 then exit(false); exit(true); end; begin assign(f,fi); reset(f); readln(f,n); close(f); kq:= true; while n<>0 do begin kq:= kq and nt(n); n:= n div 10; end; assign (f,fo); rewrite(f); if kq then write(f,'1') else write(f,'0'); close(f); end. Bài 2: const %,`$ tfi='DIV.INP'; tfo='DIV.OUT'; var n: longint; a, s: array[0 1001] of longint; res: longint; function ok(t: longint): boolean; var i,u,tong: longint; begin tong:=0; for i:=1 to n do if a[i]<>0 then begin tong:=tong+a[i]; if tong=t then tong:=0; end; exit(tong=0); end; procedure main; var j,u,i,k,t: longint; begin assign(input,tfi); reset(input); assign(output,tfo); rewrite(output); read(n); for i:=1 to n do read(a[i]); s[0]:=0; for i:=1 to n do s[i]:=s[i-1]+a[i]; for k:=n downto 1 do if s[n] mod k=0 then begin t:=s[n] div k; if ok(t) then begin res:=k; break; end; end; writeln(res); close(input); close(output); end; BEGIN main; END. Bài 3 const fi='SQUARE.INP'; fo='SQUARE.OUT'; var f:text; a,nga,doc:array[1 1000,1 1000] of integer; %h`$ i,m,n,d,j:integer; procedure nhap; var i,j:integer; begin assign(f,fi); reset(f); readln(f,m,n); for i:=1 to m do begin for j:=1 to n-1 do read(f,nga[i,j]); readln(f); end; for i:=1 to m-1 do begin for j:=1 to n do read(f,doc[i,j]); readln(f); end; end; begin nhap; d:=0; for i:=1 to m-1 do for j:=1 to n-1 do if nga[i,j]+nga[i+1,j]+doc[i,j]+doc[i,j+1]=4 then inc(d); assign(f,fo); rewrite(f); write(f,d); close(f); end. %`$ . !"  Đề thi gồm 03 câu, trong 02 trang #$%&%'()%*)" * Các file chương trình và file dữ liệu được đặt tên chính xác như sau: $+, /.01,  0- 20.3% 4-5 20.3%67. trang) <OP? IT;:WFtuu$)*&apos ;-& apos;:0 'E v%!wIY? <QQ@R=S <T%)6U,V) 19)  4- )7+:W.X   19) .X   [Q]:0 7:??. to n-1 do read(f,nga[i,j]); readln(f); end; for i:=1 to m-1 do begin for j:=1 to n do read(f,doc[i,j]); readln(f); end; end; begin nhap; d:=0; for i:=1 to m-1 do for j:=1 to n-1 do

Ngày đăng: 24/07/2015, 18:14

w