更多"有如下程序: #include <iostream> void f"的相关试题:
[单项选择]有如下程序:
#include <iostream>
void fun(int& x, int y)int t=x;x=y;y=t;
int main ( )
int a[2]=23,42;
fun(a[1],a[0]);
std::cout<<a[0]<<","<<a[1]<<std::endl;
return 0;
执行后的输出结果是
A. 42,42
B. 23,23
C. 23,42
D. 42,23
[单项选择]有如下程序:
#include<iostream>
void fun(int&x, int y)int t=x; x=y; y=t;
int main( )
int a[2]=23,42;
fun(a[1],a[0]);
std::cout<<a[0]<<","<<a[1]<<std::end1;
return 0;
执行后的输出结果是( )。
A. 42,42
B. 23,23
C. 23,42
D. 42,23
[单项选择]有以下程序:
#include<iostream.h>
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<iostream.h>
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,2);
cout << X < < ‘,’ < < y < < ‘,’ < < z < < endl;
输出结果是
A. 30,20,10
B. 10,20,30
C. 456,567,678
D. 678,567,456
[单项选择]有以下程序
#include<iostream,h>
int i=0;
void fun( )
Static int i=1
Std::cont<<i++<<’,’;
Std::cout<<i<<’,’;
int main( )
fun( );fun( );
return 0;
程序执行后的输出结果是( )。
A. 1,2,1,2,
B. 1,2,2,3,
C. 2,0,3,0,
D. 1,0,2,0,
[单项选择]有以下程序
#include<iostream.h>
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<iostream.h>
void fun(int n)
{
int x(5);
static int y(10);
if(n>0)
{
++x;
++y;
cout<<x<<","<<y<<endl;
}
}
void main( )
int m(1);
fun(m);
}
则该程序的输出结果是______。
[填空题]阅读下面程序:
#include<iostream.h>
void fun(int n)
{
int x(5);
static int y(10);
if(n>0)
{
++x;
++y;
cout<<x<<","<<y<<end1;
}
}
void main( )
{
int m(1);
fun(m);
}
则该程序的输出结果是______。
[单项选择]下列程序的运行结果是
#include<iostream.h>
void fun(int *a,int *B)
int *k;
k=a;a=b;b=k;
void main( )
int a=3,b=6,*x=&a,*y=&b;
fun(x,y);
cout << a <<" "<< b;
A. 63
B. 36
C. 编译出错
D. 00