更多"以下程序段的执行结果为 【15】 。#include<iostream"的相关试题:
[填空题]以下程序段的执行结果为 【15】 。
#include<iostream.h>
#define PLUS(x, y) x+ y
void main( )
{
int x=1, y=2,z=3,sum;
sum=PLUS(x+ y, z)*PLUS(y, z);
cout<<"SUM="<<sum;
cout<<end1;
}
[单项选择]关于以下程序段的执行结果,说法正确的是( )。
public class borley extends Thread
(
public static void main(String argv[])
borley b=new borley( );
b.start( );
public void run( )
System.out.println( "running" );
A. 编译通过并执行,但无输出
B. 编译通过并执行,输出:running
C. 产生错误,没有thread类对象
D. 产生错误,没有通道到达thread包
[填空题]执行以下程序的输出结果是______。
#include
#define M 5
#define N M+M
main( )
int k;
k=N*N*5; printf("%d/n",k);
[单项选择]以下程序段的执行结果是( )。
int a,y:
a=l0;y=10
do
a+=2;
y+=a;
cout<<"a"="<<a<<","<<"y="<<y<<"/n";
if(y>20)break:
while(a<=14);
A. a=12,y=12
B. a=12,y=12
C. a=12,y=12
D. a=12,y=12
[单项选择]以下程序段的执行结果是______。
int s=0,i=1;
do
{ S+=i++; }
while(i<=10);
Console.WriteLine("sum={0}",sum);
A. sum=54
B. sum=1
C. sum=55
D. sum=30
[填空题]以下程序段的执行结果是______。
int i =0;
outer:while(true)
{
i++;
inner:for(int j = 0; j <10; j++)
{
i += j;
if(j == 3)
continue inner;
break outer;
}
continue outer;
}
System. out .println (i);
[填空题]以下程序的执行结果是 【15】 。
#include<iostream>
#define PI____3.14159
const int R=10;
void main( )
{
double a,b;
ac2*R*PI;
b=R*R*PI;
cout<<"a="<<a<<","<<"b="<<b<<endl;"
}
[填空题]以下程序的执行结果是 【15】 。
#include<iostream>
#define PI____3.14159
const int R=10;
void main( )
double a,b;
ac2*R*PI;
b=R*R*PI;
cout<<"a="<<a<<","<<"b="<<b<<endl;"
[单项选择]以下程序段的执行结果是 ______。 Dim A(3, 3) For m = 1 To 3 For n = 1 To 3 If n = m Or n = 3 - m + 1 Then A(m, n) =m + n Else A(m, n) = 0 End If Next n Next m For m = 1 To 3 For n = 1 To 3 Print A(m, n); Next n Print Next m
A. 1 1 1 1 1 1 1 1 1
B. 2 0 4 0 4 0 4 0 6
C. 0 0 0 0 0 0 0 0 0
D. 1 0 1 0 1 0 1 0 1
[单项选择]下列程序段的执行结果为( )。
#include<iostream>
using namespace std;
class example
int n;
public:
example(int i)n=i;
void add( )s+=n;
static int s;
void pr( )
cout<<s<<endl;
;
int example::s=0;
int fuc(char *x);
int main( )
example x(2),y(3),z(4);
x. add( );
y. add( );
z.pr( );
return 0;
A. 2
B. 3
C. 5
D. 6
[填空题]下列程序段的执行结果是 【14】 。
For I = 1 to 5
Clls
Print "I =" , I
NEXT
[填空题]有以下程序段:
#include<iostream.h>
#define MIN(x,y) (x)<(y)(x):(y)
void main( )
int i,j,K;
i=10;j=15;
k=10*MIN (i,j);
cout<<k<<endl;
程序执行后的输出结果是______。
[单项选择]下列程序段的执行结果为 m=1 n=1 Select Case m Case 1 Select Case n Case 0 print "A" Case 1 Print "B" End Select Case 2 Print "C" End Select
A. A
B. B
C. C
D. 0