下面程序的运行结果是( )。#include <iostream.h>void main(){static int a[][4]={ 1,2,3,4,5,6,7,8,9,10,11,12};int i, j, sum=0;for(i=0;i<3;i++)for(j=0;j<4;j++)if(j>i)sum+=a[i][j];cout<<sum<<end1;}
A.24
B.30
C.36
D.40
第1题:
以下程序的执行结果是______
include<iostream.h>
void func(int);
void main()
{
int k=4
func(k) ;
func(k) :
cout<<end1;
}
void func(int a)
{
static int m=0;
m+=a;
cout<<m<<" ";
}
第2题:
下面程序的运行结果是
#include<iostream.h>
Void main( )
{
int num=1;
int &ref=num;
ref=ref+2;
cout < < num;
num=num+3;
cout < < ref < <endl;
}
A.13
B.16
C.36
D.33
第3题:
下面程序的输出结果是【 】。
define MIN(a,b) (((a)<(b))?a:b)
include <iostream.h>
void main()
{
int x= 3, y=5;
cout<< MIN(x,y)<<end1;
}
第4题:
以下程序的输出结果是【 】。
include<iostream.h>
void main( )
}
int a=0;
a+=(a=8) ;
cout<<a;
}
第5题:
下面程序的运行结果是
#include<iostream.h>
int fun(int a[ ] ,int n)
{
int result=1;
for(int i=1;i<n;i++)
result=result * a[i] ;
retum result;
}
void main( )
{
int a[3] ={3,4,5};
cout
A.12
B.15
C.20
D.60
第6题:
阅读下面程序:
include<iostream.h>
void f(int n)
{
int x(5);
static int y(10);
if(n>0)
{
++x;
++y;
cout<<x<<","<<y<<endl;
}
}
void main()
{
int m(1);
f(m),
}
则该程序的输出结果是【 】
第7题:
下面程序的运行结果是
#include<iostream.h>
void fun(int * a,int * b)
{
int x= * a;
* a= * b; * b=X;
cout < < * a < < * b < <" ";
}
void main( )
{
int x=1,y=2;
fun(&x,&y) ;
cout < < X < < y < < endl;
}
A.12 12
B.12 21
C.21 12
D.21 21
第8题:
阅读下面程序:
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);
}
则该程序的输出结果是______。
第9题:
下面程序的运行结果是
#include<iostream.h>
void main( )
{
int i=1;
while(i <=8)
if(++i%3!=2) continue;
else cout < < i;
}
A.25
B.36
C.258
D.369
第10题:
阅读下列程序:
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);
}
则该程序的输出结果是______。