更多"以下程序运行后的输出结果是______。
#define Pow"的相关试题:
[填空题]以下程序运行后的输出结果是______。
#define Power2(x) x*x
main( )
int i=6,j=8;
printf("%d/n",Power2(i+j));
[单项选择]以下程序运行后,单击按钮输出结果是
Private Sub Commandl_Click( )
Dim x As Integer,y As Integer,z As Integer
X=4:y=2: Z=3
Call Gopd(x,x,z)
Print x;X;Z
Call Gopd(x,y,y)
Print x;y;y
End Sub
Private Sub Gopd(x As Integer,y As Integer,z As Integer)
X=3 * Z + 1
y=2 * z
z=x + y
End Sub
A. 6 6 12
B. 8 5 10
C. 9 6 12
D. 8 10 10
[填空题]以下程序运行后的输出结果是【 】。
struct NODE
{int num;struct NODE *next;
};
main( )
{struct NODE s[3]={{1,’’/0’’},{2,’’/0’’},{3,’’0’’}},*p,*q,*r;
int sum=0;
s[0].next=s+1;s[1].next=s+2;s[2].next=s;
p=s; q=p->next; r=q->next;
sum+=q->next->num; sum+=r->next->next->num;
printf("%d/n",sum);
}
[单项选择]以下程序运行后,单击按钮输出结果是( )。
Private Sub Commandl_Click( )
Dim x As Integer,y As Integer,z As Integer
X=4:y=2: Z=3
Call Gopd(x,x,z)
Print x;X;Z
Call Gopd(x,y,y)
Print x;y;y
End Sub
Private Sub Gopd(x As Integer,y As Integer,z As Integer)
X=3 * Z + 1
y=2 * z
z=x + y
End Sub
[填空题]以下程序运行后的输出结果是 【17】 。
struct NODE
{ int k;
struct NODE*link;
};
main( )
{ struct NODE m[5],*p=m,*q=m+4;
int i=0;
while(p!=q){
p->k=++i;p++;
q->k=i++;q--;
}
q->k=i;
for(i=0;i<5;i++)printf("%d",m[i].k);
printf("/n");
}
[填空题]以下程序运行后的输出结果是 【16】 。
struct NODE
int num;
stmct NODE *next;
;
main( )
struct NODE s[3]=1,’/0’),2,’/0’),3,’/0’),*p,*q,*r;
int sum=0;
s[0].next=s+1;
s[1].next=s+2;
s[2].next=s;
p=s
q=p->next;
r=q->next;
sum+=q->next->num;
sum+=r->next->next->num;
printf("%d/n",sum);
[填空题]以下程序运行后输出结果是 【18】 。
#include <stdio, h>
void swap(int x.int y)
{ int t;
t = x;x = y;y = t: printf( "% d % d ",x,y);
}
main ( )
{ iht a=3,b=4:
swap(a,b); prinff( "% d % d" ,a,b);
}
[填空题]以下程序运行后的输出结果是 【10】 。
#include <iostream>
#include <string>
using namespace std;
class Y;
class X
{
iht x;
char *strx;
public:
X(int a,char *str)
{
x=a;
strx=new char[strlen(str)+1];
strcpy(strx,str);
}
void show(Y &ob);
};
class Y
{
private:
iht y;
char *stry;
public:
Y(int b,char *str)
{
y=b;
stry=new char[strlen(str)+ 1] ;
strcpy(stry, str);
}
friend void X::show(Y &ob);
};
void X::show(Y &ob)
{
cout<<strx<<",";
cout<<ob.stry<<endl;
}
int main( )
{
X a(10,"stringX");
Y b(20,"stringY");
a.show(b);
return 0;
}
[填空题]以下程序运行后的输出结果是 【14】 。
#include <iostream>
#include <string>
using namespace std;
class Y;
class X
int x;
char *strx;
public:
X(int a,char *str)
x=a;
strx=new char[strlen(str)+1];
strcpy(strx,str);
void show(Y &ob) ;
;
class Y
private:
int y;
char *stry;
public:
Y(int b,char *str)
y=b;
stry=new char[strlen(str)+1];
strcpy(stry, str);
friend void X::show(Y &ob) ;
;
void X::show(Y &ob)
cout<<strx<<",";
cout<<ob.stry<<end1;
int main( )
X a(10,"stringX");
Y b(20,"stringY");
a. show (b) ;
return O;
[单项选择]以下程序运行后的输出结果是
#include<stdio.h>
#include<stdlib.h>
main( )
int *a, *b, *c;
a=b=c(int *) malloc(sizeof(int));
*a=1; *b=2; *c=3;
a=b;
printf("%d, %d, %d/n", *a, *b, *c);
A. 3,3,3
B. 2,2,3
C. 1,2,3
D. 1,1,3
[填空题]以下程序运行后的输出结果是 【11】 。
Private Sub Form _ Click( )
i=10 :j=0
Do
j=j+1
i=i-1
Loop while i>2
Print j;
End Sub
[填空题]以下程序运行后的输出结果是 【10】 。
#include <iostream>
#include <string>
using namespace std;
class Y;
class X
iht x;
char *strx;
public:
X(int a,char *str)
x=a;
strx=new char[strlen(str)+1];
strcpy(strx,str);
void show(Y &ob);
;
class Y
private:
iht y;
char *stry;
public:
Y(int b,char *str)
y=b;
stry=new char[strlen(str)+ 1] ;
strcpy(stry, str);
friend void X::show(Y &ob);
;
void X::show(Y &ob)
cout<<strx<<",";
cout<<ob.stry<<endl;
int main( )
X a(10,"stringX");
Y b(20,"stringY");
a.show(b);
return 0;
[填空题]
以下程序运行后的输出结果是()。
#include
#include
#include
main( )
{ char *p;int i;
p=(char*)malloc(sizeof(char)*20);
strcpy(p,"welcome");
for(i=6;i>=0;i--) putchar(*(p+i));
printf("/n"); free(p);
}
[填空题]以下程序运行后的输出结果是 。
#include <stdio, h>
main( )
int a=3,b=4,c=5,t=99;
if(b<a && a<c) t=a;a=c;c=t;
if(a<e && b<c) t=b;b=a;a=t;
printf( "%d %d %d //n" ,a,b,e);
[单项选择]以下程序运行后的输出结果是
#include<stdio.h>
main( )
FILE *fp;int i=20,j=30,k,n;
fp=fopen("d1.dat","w");
fprintf(fp,"%d/n",i);
fprintf(fp,"%d/n",j);
fclose(fp);
fp=fopen("d1.dat","r");
fscanf(fp,"%d%d",&k,&n);
printf("%d%d/n",k,n);
fclose(fp);
A. 20 30
B. 20 50
C. 30 50
D. 30 20