更多"程序 #include'iostream.h' void main"的相关试题:
[填空题]程序
#include" iostream.h"
void main( )
int i=10;
jnt j=5;
cout < < j+i++ < < end1;
的结果为 【7】
[单项选择]有以下程序
#include
void fun(int *s,int nl,int n2)
int i,j,t;
i=nl; j=n2;
while(i<j)  T=S[i]; S[i]=S[j]; S[j]=T; i++; j--; main( )
int a[10]=1,2,3,4,5,6,7,8,9,0,k;
fun(a,0,3); fun(a,4,9); fun(a,0,9);
for(k=0;k<10;k++)printf("%d",a[k]); printf("/n");程序运行的结果是______。
A. 0987654321
B. 4321098765
C. 5678901234
D. 0987651234
[单项选择]有以下程序
#include
void fun(int a,int b,int c)
{ a=456,b=567,c=678;}
void main( )
{
int x=10,y=20,z=30;
fun(x,y,z);
cout<<x<<’,’<<y<<’,’<<z<<endl;
}
输出结果是
A. 30,20,10
B. 10,20,30
C. 456,567,678
D. 678,567,456
[单项选择]下列程序的输出结果是 #include void main( )
{ char * str="12123434"; int x1=0,x2=0,x3=0,x4=0,i;
for(i=0;str[i]!=’/0’;i++) switch(str[i]) {
case’1’:x4++; case’2’:x3++; case’3’:x2++;
case’4’:x1++; } cout < < x1 < < ","
< < x2 < < "," < < x3 < < "," < < x4;
A. 8,6,4,1
B. 8,6,3,2
C. 8,8,4,1
D. 8,6,4,2
[填空题]下列程序的执行结果为【15】。
#include
void main( )
cout.fill( ’ * ’ );
cout.width(10);
cout<<"hello"<
[单项选择]下列程序的输出结果是
#include
void main( )
char * str="12123434";
int x1=0,x2=0,x3=0,x4=0,i;
for(i=0;str[i]!=’/0’;i++)
switch(str[i])
case’1’:x4++;
case’2’:x3++;
case’3’:x2++;
case’4’:x1++;
cout < < x1 < < "," < < x2 < < "," < < x3 < < "," < < x4;
A. 8,6,4,1
B. 8,6,3,2
C. 8,8,4,1
D. 8,6,4,2
[单项选择]有如下程序:
#include" iostream.h"
void main( )
int x=1, a=0, b=0;
switch(x)
case O:b++;
easel:a++;
case2:a++:b++:
cout<<"a ="<<a<<"," <<"b="<<b;
该程序的输出结果是( )。
A. a=2,b=1
B. a=l, b=1
C. a=1,b=0
D. a=2,b=2
[单项选择]有以下程序
#include
void fun(int a,int b)
{ int t;
t=a;a=b;b=t;
}
main( )
{ int c[10]={1,2,3,4,5,6,7,8,9,0},i;
for(i=0;i<10;i+=2) fun(c[i],c[i+1]);
for(i=0;i<10;i++) printf("%d,",c[i]);
printf("/n");
}
程序的运行结果是
A. 1.2,3,4,5,6,7,8,9,0,
B. 2,1,4,3,6,5,8,7,0,9,
C. 0,9,8,7,6,5,4,3,2,1,
D. 0,1,2,3,4,5,6,7,8,9,
[填空题]以下程序的输出结果是______。
#include
void main( )
{ int a=0;
a+=(a=8);
cout<<a;
}
[填空题]下列程序的执行结果为【15】。
#include
void main( )
{
cout.fill( ’ * ’ );
cout.width(10);
cout<<"hello"< }
[单项选择]若有如下语句
#include
void main( )
{
int x=3;
do{
x=x-2;
cout<<x;
}while(!(--x));
}
则上面程序段
A. 输出的是1
B. 输出的是1和-2
C. 输出的是3和0
D. 是死循环
[单项选择]有以下程序
#include
void fun(int a,int b,int C)
a=456,b=567,c=678;
void main( )
int x=10,y=20,z=30;
fun(x,y,z);
cout < < x < < ’,’ < < y < <’,’ < < z < < end1;
输出结果是
A. 30,20,10
B. 10,20,30
C. 456,567,678
D. 678,567,456
[单项选择]以下程序的输出结果是
#include<iostream.h>
void main( )
int x=1,y=3;
cout < < x++ < < ",";
int x=0;x+=y * 2;
cout < < x < <"," < < y < <",";
cout < < x < < "," < < y;
A) 1,6,3,1,3 B) 1,6,3,6,3 C) 1,6,3,2,3 D) 1,7,3,2,3