更多"[单选题]以下程序运行后输出结果是( )#include <io"的相关试题:
[单选题]以下程序的输出结果是( )。
#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 x=1;
switch(x)
{ case 1:++x;
case 0:--x;
default: x+=7;
}
cout << x << endl;
return 0;
}
A. 2
B. 1
C. 7
D. 8
[单选题]下列程序运行后的输出结果是( )。
#include
Using namespace std;
Int main()
{
int x,y,z;
for (x=0;x<=3;x++)
z=x;
for (y=5;y>=1;y--)
z+=y;
cout << z << endl;
return 0;
}
A. 15
B. 16
C. 17
D. 18
[单选题]下列程序的运行结果是:( )
#include
using namespace std;
int main()
{
int a=2;
int b=a+1;
cout<A.0.66667
B.0
C.0.7
D.0.6666666…
[单选题]有以下程序
#include
Using namespace std;
Int main(){
int a;
cin >> a;
if(a++<9) cout << a;
else cout << a--;
return 0;
}
程序运行时从键盘输入9 回车,则输出结果是( )。
A. 10
B. 11
C. 9
D. 8
[单选题]执行下列程序语句后,屏幕输出为( )。
#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 a{5};
Int main()
{
{
int a{2};
cout << ::a;
cout << a;
}
cout << a << endl;
return 0;
}
[单选题]以下程序段运行后的输出结果是( )。
Int main()
{ char str[][9]={"hello", "student", "computer"};
cout << str[1];
return 0;
}
A. h
B. hello
C. student
D. computer
[单选题]
执行以下语句输出的结果是( )
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
Using namespace std;
Int main(
{
int s,i;
for ( s=0,i=1; i<4; i++,s+=i );
cout << s << endl;
return 0;
}
[单选题]以下程序输出结果是 。
#include "stdio.h"
void f ();
main()
{int a;
for(a=1;a<=3;a++)
fun();
}
void fun()
{static int i=1;
i+=3;
printf("%2d",i);
}
A.4 7 10
B.4 4 4
C.4 5 6
D.4 6 8
[单选题]有如下程序:
#include
using namespace std;
class Base{
protected:
Base(){cout<<'A';}
Base(char c){cout<A.B
B.BA
C.AB
D.BB
[单选题]有如下程序:
#include
Using namespace std;
Int main( )
{
char a;
cin >> a;
if(a = '*') cout << "***" << endl;
else cout << "###" << endl;
return 0;
}
输入字符+时,程序的运行结果是( )。
A. ***
B. ###
C. ***###
D. 无输出