更多"下列程序的输出结果是( )。
#include
"的相关试题:
[填空题]以下程序输出的结果是 【7】 。
#include<iostream.h>
voidmain( )
inta=5,b=4,c=3,d;
d=(a>b>c);
cout<<d;
[填空题]下列程序的输出结果为 【8】 。
include<iostream.h>
voidmain( )
{
inta []={10,20,30,40},*pa=a;
int*&ph=pa;
Pb++;
cout<<*pa<<end1;
}
[单项选择]下面程序的输出结果是( )。
#include
#include
voidmain()
{
charp1[10],p2[10];
strcpy(p1,"abc");
strcpy(p2,"ABC");
charstr[50]="xyz":
strcpy(str+2,strcat(p1,p2));
cout< }
A. xyzabcABC
B. zabcABC
C. xyabcABC
D. yzabcABC
[单项选择]有如下程序:
#include
voidmain()
{charch[2][5]={"6937","8254"),*p[2];
inti,j,s=0;
for(i=0;i(2;i++)p[i]=ch[i];
for(i=0;i<2;i++)
for(j=0;p[i][j]>’\0’;j+=2)
s=10*s+p[i][j]-’0’;
cout<
该程序的输出结果是( )。
A. 69825
B. 63825
C. 6385
D. 693825
[单项选择]有下列程序:
#include
voidmain()
{char*a[]={"abcd","ef","gh","ijk");inti;
for(i=0;i<4;i++)printf("%C",*a[i]);
}
程序运行后的输出结果是( )。
A. aegi
B. dfhk
C. abcd
D. abcdefghijk
[填空题]下列程序输出结果是 【13】 。
include <iostream>
using namespace std;
template <typename T>
T fun(T a, T b) {return (a<=b)a:b;}
int main( )
{
cout<<fun(3,6)<<’,’<<fim(3.14F, 6.28F)<<end 1;
return 0;
}
[填空题]下列程序输出结果是 【13】 。
include <iostream>
using namespace std;
template <typename T>
T fun(T a, T b) return (a<=b)a:b;
int main( )
cout<<fun(3,6)<<’,’<<fim(3.14F, 6.28F)<<end 1;
return 0;
[单项选择]下面的程序输出结果是( )。
#include<iostream>
using namespace std;
void add( )
static int x;
x++;
cout<<x<<’’;
int main( )
for(int i=0;i<3;i++)
add( );
return 0;
A. 111
B. 123
C. 222
D. 333
[单项选择]如下程序的输出结果是 #include<iostream> #include<iomanip> using namespace std; class CSum{ int x,y; public: CSum(int x0,int y0):X(x0),y(y0){ } friend ostream& operator<<(ostream& os,const CSum& xA) { os<<setw(5)<<xa.x+xa.y: return os; } }; int main( ){ CSum y(3,5); cout<<setfill(’*’)<<8; cout<<y; return 0; }
A. 88
B. ****88
C. ****8****8
D. 8****8
[单项选择]下面程序输出的结果是( )。
#include<iostream>
using namespace std;
int fuc (char *x);
int main( )
cout<<fuc("hello")<<endl;
return 0;
int fuc(char *x)
char *y=x;
while(*y! =’/0’)y++;
return(y-x);
A. 5
B. 6
C. 0
D. 语法错误,不能输出结果
[单项选择]下面程序输出的结果是
#include<iostream.h>
void main( )
inti;
int a[3] [3] =1,2,3,4,5,6,7,8,91;
for(i=0;i<3;i++)
cout < < a[2-i] [i] < < " "; A) 1 5 9 B) 7 5 3 C) 3 5 7 D) 5 9 1
[填空题]以下程序输出的结果是 。
#include<iostream.h>
void main( )
{
int a=5,b=4,c=3,d;
d=(a>b>c) ;
cout < < d;
}
[填空题]以下程序输出的结果是【 】。
#include<iostream.h>
voidmain( )
{
inta=5,b=4,c=3,d;
d=(a>b>c);
cout<<d;
}