更多"下面程序的输出结果是( )。 #include<iostream>"的相关试题:
[单项选择]下面程序输出的结果是( )。 #include<iostream> using namespace std; int test(int n1,int n2) {return n1 +n2;} float test (int f1,float f2){return f1-f2;} float test(float x,float y){return(x+y)/2;} float test(float x,int y){return(x+y)*2;} void main( ){ int a1=10; float a2=2.5f; cout<<test(a1,a2); }
A. 12.5
B. 7.5
C. 6.25
D. 25
[单项选择]下面程序的输出结果是( )。 #include<iostream> #include<string> using namespace std; void main( ){ charp1[10],p2[10]; strcpy(p1,"abc"); strcpy(p2,"ABC"); charstr[50]="xyz"; strcpy(str+2,strcat(p1,p2)); cout<<str; }
A. xyabcABC
B. yzabcABC
C. xyzabcABC
D. zabcABC
[单项选择]下面程序的输出结果是
#include<iostream.h>
#include<string.h>
void main( )
char p1[10],p2[10]
strcpy(p1,"abc");
strcpy(p2,"ABC");
char str[50]="xyz";
strcpy(str+2,strcat(p1,p2));
cout<<str;
A. xyzabcABC
B. zabcABC
C. xyabcABC
D. yzabcABC
[单项选择]下面程序输出的结果是
#include<iostream.h>
void main( )
int i;
int a[3][3]=1,2,3,4,5,6,7,8,9;
for(i=0;<3;i++)
cout<<a[2-i][i]<<" ";
A. 1 5 9
B. 7 5 3
C. 3 5 7
D. 5 91
[单项选择]下面程序的输出结果是( )。
#include <iostream.h>
#include "string.h"
void main( )
char a[]="welcome",b[]="well";
strcpy(a,b);
cout<<a<<endl;
A. wellome
B. well com
C. well
D. well we
[单项选择]下面程序的输出结果是( )。
#include<iostream.h>
#include"string.h"
void main( )
char a[]="Hello Test",b[]="Test";
strcpy(a,b);
cout<<a<<end1;
A. Hello
B. Test
C. Hello Test
D. Hello Test HelloTest
[单项选择]下面程序的输出结果是( )。
#include<iostream>
using namespace std;
void main( )
int i=1;
while(i<=8)
if(++i%3!=2)continue;
else cout<<i;
A. 369
B. 258
C. 36
D. 25
[单项选择]下面程序的输出结果是()。
#include<iostream>
using namespace std;
template<class T>
T max(T x,T y)
return(x>=y x:y);
void main( )
cout<<max(5,8)<<endl;
cout<<max("zhangsan","lisi");
A. 8
B. 8
C. 5
D. 5
[单项选择]下面程序的输出结果是( )。
#include <iostream>
using namespace std;
void main( )
int s;
for(int k=2;k<6;k+=2)
s=1;
for(int j=k;j<6;j++) s+=j;
cout<<s<<endl;
A. 9
B. 1
C. 11
D. 10
[填空题]下面程序的输出结果是【 】。
#include<iostream.h>
void main( )
{
int a[6]={1,2,3,4,5,6};
for(int i=0;i<5;i++)
cout<<a[i]<<"";
cout<<endl;
=