您现在的位置: 中国考试网

1995年计算机水平考试试题

2001年04月20日    
试题 1 ( 15分 )

阅读下列程序流程图 ,从供选择的答案中找出应该填入 ( )处的字句

,并写在答卷的对应栏内 .


供选择的答案:

(a) 2, 0, -3, 7 (b) 0, -3, 2, 7 (c) -3, 0, 7, 2 (d) 7, 2, 0, -3

(e) 2, 0, -3, -3 (f) -3, 0, 2, 7 (g) 2, 2, 0, -3 (h) 2, 0, 7, -3


设 N=4 ,数组 A 的初值为 2,0,-3,7 (即 A[1]=2,A[2]=0,A[3]=-3,A[4]=7 ).

<1> 程序执行完后, A 的值为 ( ).

<2> 若原流程图中,仅把I)框改为 I->J,则程序执行完后,A的值为( ).

<3> 若原流程图中,仅把III)框改为J:N-1,则程序执行完后,A的值为( ).

<4> 若原流程图中,仅把II)框改为 A[I]->A[J]

A[J]->T

T->A[I]

则程序执行完后, A 的值为 ( ).


试题 2 (15)

阅读下列求 S= X 的流程图, 从供选择的答案中找出应填入 a-g 处的字句.

供选择的答案

1,2: a. 读入X b. 读入S c. 读 入j d. 读入N e. 读入X

3,5: a. i:2 b. i:3 c. i:4 d. i:N e. j:2 f. j:3 g. j:4 h. i:j i. j:N

4: a.S*X ->S b. M*X ->S c. S+M ->S d. S+M ->S e. S+X ->S f. M+X ->S

6,7: a. <= b. < c. = d. >= e. > f. <>


阅读下列 pascal 程序, 把应该填入_______处的字句写在答卷的对应栏内.

试题3 ( 15分 )

[程序的说明] 本程序以如下格式打印杨辉三角形 (又称pascal三角形 )的前10行.

1

1 1

1 2 1

1 3 3 1

1 4 6 4 1

1 5 10 10 5 1

1 6 15 20 15 6 1

[程序]

program pascaltriangle (output);

const lastrow = 10;

var row,col:2..lastrow;

fe:1..lastrow;

pascal: array [1..lastrow] of integer;

begin pascal[1] := 1;

writeln (pascal[1]);

for row := 2 to lastrow do

begin pascal[row] := 1;

for col := _________ do

pascal[col] := pascal[_______] + pascal[_______];

for fe := 1 to _______ do

write (pascal[fe]);

__________

end

end.


试题 4 (20分)

[程序的说明] 本程序用来打印读入的正文, 并统计和打印该正文中所包含的行,

句和字的数目以及娒扛鲎帜赋鱿值钠刀*. 规定句号(.)作为句子的结束, 不作它

用 ; 字仅由字母组成且每个字不跨行.

[程序]

program textprocess (input,output);

var ch: char; g: boolean; i: integer;

letter: array [`A'..`Z'] of integer;

begin g:=false;

for ch:=`A' to `Z' do letter [ch]:=0;

wordnum:=0; sentencenum:=0;

linenum:=0;

read (ch);

while not eof do

if not eoln then

if ________ then

begin while (ch >= _______ ) and (ch <=_______ )do

begin write (ch);

letter [ch] := letter[ch] + 1;

____________ ;

g := true

end;

if g then

begin ___________;

wordnum := wordnum + 1

end

else begin write (ch); read (ch)

end

end

___________ begin _________________________ ;

write (ch); read (ch)

end

else begin _________________________ ;

writeln; read (ch)

end;

writeln; writeln;

writeln (`linenum = ' , linenum);

writeln (`sentencenum = ' , sentencenum);

writeln (`wordnum = ' , wordnum);

for ch:=______ to ______ do

writeln (ch:3,`:',letter[ch] :6);

writeln

end.

试题 5 ( 25分 )*

[程序的说明] 读入一串整数, 按递增次序枸成一个二叉树.例如: 对以下八个数:

97, -426, 278, 9, -627, 301, 156, 98 构成如右图所示的二叉树.

[程序]

program binarytree (input,output);

type trees = ^boxes;

boxes = record value:integer;

left,right:trees

end;

var valofnode: integer;

root: trees

procedure add (int: integer; var t: trees);

begin if t = nil then

begin ________________ ;

with t^ do

begin value := ____________ ;

left := ____________ ;

right := ____________

end

end

else with t^ do

if ___________ then

add(int,left)

else ____________

end; {add}

begin {main program}

root := nil;

repeat read (valofnode);

________________

until eof

end.

相关内容:
高校招办主任谈专业选择的误区 [2006-06-28]
高考中体育加分公示背后有蹊跷? [2006-06-28]
专家支招:选专业课辅导班要“四看” [2006-06-28]
华图专家支招:公务员面试中如何应对棘手问题 [2006-06-28]
2006年辽宁省高校将有73个专业新增学士学位 [2006-06-28]
云南昆明第48次自考考场座次查询系统开通 [2006-06-28]
重庆江北区06年4月自学考试复查结果通知 [2006-06-28]
南京一中出个艺术类状元:学艺术兴趣最重要 [2006-06-28]

 

程序设计考试说明计算机网络考试说明
1995年计算机水平考试试题一九九六年度初级程序员级
一九九六年度初级程序员级 1999年度初级程序员级 下午
公证员统一考试取消 通过国“英语培训”圈走中国人多少
新东方在多伦多开分校1月26日雅思考试 口试告别背
有消息称GRE考试将增加“分湖南省2002年三次自考的报名
教育部考试中心:今年托福、2002年上海市高等教育自学考
英国使馆8月18日将举办留学安徽省自考办整肃考风考纪动
深圳公务员招考有望进高校湖南省长沙第41次自学考试考
关于开通山东自考声讯热线的报关员考试网上报名