28、以下程序的输出结果是: a = 30 b = 1 if a >=10: a = 20 elif a>=20: a = 30 elif a>=30: b = a else: b = 0 print('a={}, b={}'.format(a,b))
A.a=30, b=1
B.a=30, b=30
C.a=20, b=20
D.a=20, b=1
第1题:
有如下程序,运行输出的结果是 ______ 。 s=0 Do s=(s+1)*(s+2) n=n+1 Loop Until s>=30 Print n; s
A.0 1
B.30 30
C.4 30
D.3 182
第2题:
有以下程序:
#include<stdio.h>
main( )
{ int a=1,b=0;
if(--a)b++;
else if(a==0)b+=2;
else b+=3:
print[("%d\n",b);
}
程序运行后的输出结果是( )。
A.0
B.1
C.2
D.3
第3题:
有以下程序
main()
{ int a=0, b=0;
a=10; /* 给 a 赋值
b=20; 给 b 赋值 */
printf("a+b=%d\n",a+b); /* 输出计算结果 */
}
程序运行后的输出结果是
A)a+b=10
B)a+b=30
C)30
D) 出错
第4题:
有如下程序: Private Sub Command1_Click() s = 0 Do s=(s+1) ( (s+2) N=N+1 Loop Until s>=10 Print N;s End Sub 运行后的输出结果是
A.0 1
B.30 30
C.4 30
D.2 12
第5题:
以下程序运行后的输出结果是______。 main() { int a,b,c; a=10;b=20;c=(a%b<1)||(a/b>1); printf("%d %d %d\n",a,b,c); }
A.10 20 1
B.20 10 0
C.10 20 0
D.10 10 0
第6题:
以下程序的执行结果是【 】。
include<iostream.h>
void main()
{
int a=0,b=1,c=0,d=20;
if(a) d=d-10;
else if(!b)
if(!c) d=15;
else d=25;
cout <<"d="<<d<<endl;
}
第7题:
有以下程序: #include<iostream> using namespace std; int n[][3]={10,20,30,40,50,60}; int main() { int (*p)[3]; p=n; cout<<p[0] [0]<<","<<*(p[0]+1)<<","<<(*p) [2]<<end1; return 0; } 上述程序执行后的输出结果是( )。
A.10,20,30
B.20,30,40
C.10,30,50
D.10,40,60
第8题:
有以下程序 main() {int a=0,b=0; a=10; /* 给a赋值 b=20; 给b赋值 */ printf("a+b=%d\n",a+b);/* 输出计算结果 */ } 程序运行后的输出结果是______。
A.a+b=10
B.a+b=30
C.30
D.出错
第9题:
以下程序的输出结果是( )。 #include <iostream> using namespace std; int main(){ int a=1,b; switch(a){ case 1:b=30; case 2:b=20; case 3:b=10; default:b=0; } cout<<b<<endl; return 0; }
A.30
B.20
C.10
D.0
第10题:
以下程序运行时,单击窗体后,在窗体上输出的结果是 ______。 Private SubForm_Click() Dim a As Integer,b As Integer a=10 :b=20 Call ff(a,B)Print a,b End Sub Private Sub ff(x As Integer,y As Integer) x=x+y y=x+y End Sub
A.30 50
B.30 30
C.20 20
D.10 20