主题:各为高手帮忙做套题啊
邻居的老师在远程教育学习不懂要我帮忙但我没有学这种语言望各位高手帮帮忙感激不尽啊
选择结构的习题:
1.选择题
(1)设已有如下的变量说明:
Var b1:boolean;
c:char;
u:real;
m, n, a:integer;
下面程序段中错误的是:
A) case b1 of B) Case c of
False:write(‘false’); ‘x’:writeln(‘c=x’);
True:write(‘true’); ‘y’:writeln(‘c=y’);
End; ‘z’:writeln(‘c=z’);
End;
C) Case u of D) Case m+n of
0.1, 1.1:a:=4; 1, 3:writeln(‘odd’);
0.8, 1.8:a:=6; 2, 4:writeln(‘even’);
End; End;
(2)有如下程序段
a:=False; b:=False;
c:=true; x:=10;
IF a Then x:=x-5
Else if b Then if c
Then x:=36
Else x:=45;
假设所有变量均已说明,程序运行后x的值是:
A)5 B)10 C)36 D)45
(3)有下面程序段
m:=2; s:=0;
For ch:=’a’ To ‘f’ Do
Begin
If odd(m) Then s:=s+m;
m:=m+3
End;
假设所有变量已说明,程序运行后s的值是:
A)72 B)52 C)33 D)16
(4)已知变量a, b, c的值为3,4,2执行下列代码后,变量x的值为:
If a<0 Then c:=a+b*2
Else if (a+c<b) and (c<0)
Then x:=a+b+c
Else x:=a+b-c
A)11 B)9 C)10 D)5
(5)完成a<0且12>c>0,则a=b+c功能的正确程序为:
A) If (a<0) or (12>a>0)
Then a:=a+b;
B) If (a<0) Then if (c>0) and (c<12)
Then a:=b+c;
C) If (a<0) and (0<c<12)
Then a:=b+c;
D) If (a<0) then if (c>0) or (c<12)
Then a:=b+c;
(6)设m为已赋值的整型变量,下列语句与其它3个语句不等价的是:
A) IF not ((m<-5) And (m>5)) Then write(m);
B) IF abs (m)<=5 Then write(m);
C) IF not ((m<-5) or (m>5)) Then write(m);
D) IF (m>=-5) And (m<=5) Then write(m);
选择结构的习题:
1.选择题
(1)设已有如下的变量说明:
Var b1:boolean;
c:char;
u:real;
m, n, a:integer;
下面程序段中错误的是:
A) case b1 of B) Case c of
False:write(‘false’); ‘x’:writeln(‘c=x’);
True:write(‘true’); ‘y’:writeln(‘c=y’);
End; ‘z’:writeln(‘c=z’);
End;
C) Case u of D) Case m+n of
0.1, 1.1:a:=4; 1, 3:writeln(‘odd’);
0.8, 1.8:a:=6; 2, 4:writeln(‘even’);
End; End;
(2)有如下程序段
a:=False; b:=False;
c:=true; x:=10;
IF a Then x:=x-5
Else if b Then if c
Then x:=36
Else x:=45;
假设所有变量均已说明,程序运行后x的值是:
A)5 B)10 C)36 D)45
(3)有下面程序段
m:=2; s:=0;
For ch:=’a’ To ‘f’ Do
Begin
If odd(m) Then s:=s+m;
m:=m+3
End;
假设所有变量已说明,程序运行后s的值是:
A)72 B)52 C)33 D)16
(4)已知变量a, b, c的值为3,4,2执行下列代码后,变量x的值为:
If a<0 Then c:=a+b*2
Else if (a+c<b) and (c<0)
Then x:=a+b+c
Else x:=a+b-c
A)11 B)9 C)10 D)5
(5)完成a<0且12>c>0,则a=b+c功能的正确程序为:
A) If (a<0) or (12>a>0)
Then a:=a+b;
B) If (a<0) Then if (c>0) and (c<12)
Then a:=b+c;
C) If (a<0) and (0<c<12)
Then a:=b+c;
D) If (a<0) then if (c>0) or (c<12)
Then a:=b+c;
(6)设m为已赋值的整型变量,下列语句与其它3个语句不等价的是:
A) IF not ((m<-5) And (m>5)) Then write(m);
B) IF abs (m)<=5 Then write(m);
C) IF not ((m<-5) or (m>5)) Then write(m);
D) IF (m>=-5) And (m<=5) Then write(m);