更多"以下程序在VC6平台上编译运行,程序运行后的输出结果是 #incl"的相关试题:
[填空题]以下程序运行后输出结果是 【8】 。
#include
main( )
{ int i, j;
for(i=6;i>3;i--) j=i;
printf("%d%d/n",i,j);
}
[填空题]以下程序运行后输出结果是 【9】 。
#include
main( )
{ int i,n[]={0,0,0,0,0};
for(i=1;i<=2;i++)
{ n[i]=n[i-1]*3+1;
printf("%d ",n[i]);
}
printf("/n");
}
[填空题]以下程序运行后输出结果是 【7】 。
#include
main( )
{ int a=37;
a%=9; printf("%d/n",a);
}
[填空题]以下程序运行后的输出结果是 【10】 。
#include
main( )
{ char a;
for(a=0;a<15;a+=5)
{ putchar(a+’A’); }
printf("/n");
}
[填空题]以下程序运行后输出结果是 【11】 。
#include
void fun(int x)
{ if(x/5>0) fun(x/5);
printf("/%dn",x);
}
main( )
{ fun(11); printf("/n"); }
[单项选择]以下程序运行后的输出结果是
#include<stdio.h>
struct st
int x,y; data[2]=1,10,2,20;
main( )
struet st *p=data;
printf("%d,",p->y);printf("%d/n",(++p)->x);
A. 10,1
B. 20,1
C. 10,2
D. 20,2
[单项选择]以下程序运行后,单击按钮输出结果是( )。
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
[单项选择]以下程序运行后的输出结果是
#include <stdio.h>
main( )
struct STUchar name[9];char sex;double score[2];;
struct STU a="Zhao",’m’,85.0,90.0,b="Qian",’f’,95.0,92.0;
b=a;
printf("%s,%c,%2.0f,%2.0f/n",b.name,b.sex,b.score[0],b.score[1]);
A. Qian,f,95,92
B. Qian,m,85,90
C. Zhao,f,95,92
D. Zhao,m,85,90
[填空题]以下程序运行后的输出结果是【 】。
#include<iostream.h>
void fun(int x,int y)
{ x=x+y;y=x-y;x=x-y;
cout<< x << "," <<y << " ,";=
void main( )
{ int x=2,y=3;fun(x,y);
cout<< x << "," << y << endl;=
[填空题]以下程序运行后的输出结果是 【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)+l];
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)+l];
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 0;
[填空题]
以下程序运行后的输出结果是()。
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);
}
[填空题]以下程序运行后的输出结果是 【13】 。
#include
main( )
{ int n[2] , i, j;
for(i=0;i<2;i++) n[i]=0;
for(i=0;i<2;i++)
for(j=0;j<2;j++) n[j]=n[i]+1;
printf("%d/n",n[1]);
}
[填空题]以下程序运行后的输出结果是【 】。
#include<string.h>
main( )
{char ch[]="abc",x[3][4];int i;
for(i=0;i<3;1++)strcpy(x[i],ch);
for(i=0;i<3;i++)printf("%s",&x[i][i];
printf("/n");
}
[填空题]以下程序运行后的输出结果是【 】。
#include<string.h>
void fun(char *s,int P,int k)
{int i;
for(i=p;i<k-1;i++)s[i]=s[i+2];
main( )
{char s[]="abcdefg";
fun(s,3,strlen(s));puts(s)
}
[单项选择]以下程序运行后的输出结果是
#include< string.h>
main( )
char m[20]= 'a', 'b', 'c', 'd', n[]="abe", k[]="abcde";
strcpy (m+strlen (n), k); strcat (m, n);
prinff(" % d% d /n", sizeof(m), strlen (m));
A. 20 11
B. 9 9
C. 20 9
D. 11 11
[单项选择]以下程序运行后的输出结果是
#include<stdio.h>
union pw
int i;
char ch[2];
a;
main( )
a.ch[0]=13;a.ch[1]=0;printf("%d/n",a.i);
A. 13
B. 14
C. 208
D. 209