更多"[单选题]执行下列语句后,程序的输出结果是( )。#include &"的相关试题:
[单选题]执行下列语句后,输出的结果是( )。
#include
Using namespace std;
Int main()
{
int j;
int m[3][2]={10,20,30,40,50,60};
for(j=0;j<2;j++)
cout< return 0;
}
A. 10 30
B. 20 40
C. 50 40
D. 60 40
[单选题]执行下列程序语句后,屏幕输出为( )。
#includeUsing namespace std;
Int n=5;
Int main()
{
int n=3;
n++;
::n++;
cout< return0;
}
A. 3
B. 4
C. 5
D. 6
[填空题]执行下列语句后,输出的结果是___()__。
#include
Using namespace std;
Int main(
{ int a=3,b=5;
float c=b/a;
cout << c << end1;
return 0;
}
[单选题]执行下列程序时输入123<空格>456<空格>789<回车> 输出结果是 ()。
main()
{ char s[100]; int c, i;
scanf("%c",&c); scanf("%d",&i); scanf("%s",s);
printf("%c,%d,%s\n",c,i,s);
}
A.123456789
B.1456789
C.1,23,456,789
D.1,23,456
[单选题]执行下列程序后,输出结果是( )。
#include
Using namespace std;
Void f(int x)
{
if(x)
{
cout.put(‘0’+x%10);
f(x/10);
}
}
Int main()
{
f(11001);
return 0;
}
A. 11001
B. 10001
C. 11100
D. 10011
[单选题]
执行以下语句输出的结果是( )
i=0
while i<5:
i+=1
if i==4:
continue
else:
print(i)
A.
0,1,2,3,4
B.
1,2,3,4,5
C.
0,1,2,3
D.
1,2,3,5
[单选题]
执行以下语句输出的结果是( )
a=True
b=False
if a or b and a:
print('yes')
else:
print('no')
A.
yes
B.
no
C.
True
D.
False
[单选题]下列程序执行后的输出结果是( )。
#include
#include
Using namespace std;
Int main()
{ char arr[2][4];
strcpy(arr[0],"you");
strcpy(arr[1],"me");
arr[0][3]=′&′;
cout << arr[0]; //因第一行无\0,故第二行接着输出
return 0;
}
A. you&me
B. you
C. me
D. err
[单选题]若执行下面的程序从键盘上输入9,则输出结果是( )
#include
Void main( )
{int n;
Scanf("%d",&n);
If (n++<10) printf("%d\n",n);
Else printf("%d\n",n--);}
A. 11
B. 10
C. 9
D. 8
[单选题]
执行以下语句,用户输入整数5,输出的结果是( )
n=int(input())
d={}
for i in range (1,n+1):
d[i]=i*i
print(d)
A.
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25}
B.
[1,4,9,16,25]
C.
{1: 1, 2: 4, 3: 9, 4: 16, 5: 25,6:36}
D.
[1,4,9,16,25,36]
[单选题]执行以下语句,输出的结果是:( )
a=1
b=a
a=2
print(b)
A.a
B.b
C.1
D.2
[单选题]执+264:291行下列代码,程序的输出结果是:( )
cout <<″Hex:″<< hex << 255;
A.
ff
B.hex:ff
C.Hex:ff
D.
f
[单选题]下面程序的输出结果是( )
#include
Void main( )
{ int x=10,y=10,i;
For(i=0;x>8;y=++i)
Printf("%d %d ",x--,y);
}
A. 10 1 9 2
B. 9 8 7 6
C. 10 9 9 0
D. 10 10 9 1
[单选题]以下程序运行后输出结果是( )
#include
Using namespace std;
Int
A,b;
Void f()
{ int x=20,y=25;
a=a+x+y;
b=b+x-y;
}
Int main()
{ int x=9,y=7;
a=x+y;b=x-y;
f();
cout << a << "," << b << endl;
return 0;
}
A. 61,-3
B. 16,2
C. 25,-5
D. 以上都不正确
[单选题]以下程序的输出结果是( )。
#include
Using namespace std;
Int main() {
int a=0, i;
for (i=0;i<5;i++)
{
switch (i)
{
case 0:
case 3:a+=2;break;
case 1:
case 2:a+=3;
default:a+=5;
}
}
cout << a < return 0;
}
A. 10
B. 20
C. 25
D. 30
[单选题]运行如下程序,输出结果是( )。
#include
Using namespace std;
Int main(){
int a=2,b=-1,c=2;
if(a if(b<0) c=0;
else c+=1;
cout << c << endl;
return 0;
}
A. 0
B. 1
C. 2
D. 3