以下语句中,输出结果与众不同的一个是()
第1题:
下列程序的执行结果为【15】。
#include(iostream. h>
void main()
{
Cout.fill(’*’);
cout. width(10);
cout <<”hello”<
}
第2题:
有如下4个语句:\n①cout~A~setfill(~*~)leftsetw(7)~B~endl;\n②coutsetfill(~*~)leftsetw(7)~A~~B~endl;\n③cout~A~serfill(~*~)rightsetw(7)~B~endl;\n④coutsetfill(~*~)rightsetw(7)~A~~B~endl;\n其中能显示A******B的是
A、①和③
B、①和④
C、②和③
D、②和④
第3题:
下面程序的输出结果为______
include<iostream.h>
void main()
{
cout<<"Hello\b";
}
第4题:
有如下4个语句:①cout~A~setfill(~*~)leftsetw(7)~B~endl;②coutsetfill(~*~)leftsetw(7)~A~~B~endl;③cout~A~serfill(~*~)rightsetw(7)~B~endl;④coutsetfill(~*~)rightsetw(7)~A~~B~endl;其中能显示A******B的是
A、①和③
B、①和④
C、②和③
D、②和④
第5题:
下面选项中,不属于C++语句的是( )。
A.{;}
B.cout<<"Hello!"<<endl
C.;
D.{int i=1;int f=i;cout<<f<<endl;}
第6题:
下列程序的输出结果是( )。 #include<iostream> using namespace std; int main() 于 chara[]=”Hello,Test”; Char*p=a; while(*p) { if(*p)=’a’&&*p(=’z’) cout<<char(*p+’A’-’a’); else cout<<*p; p++; } return 0; }
A.hello,test
B.Hello,Test
C.HELLO,TEST
D.hELLO,tEST
第7题:
下面程序的执行结果是______。
include<iostream.h>
include<iomanip.h>
using namespace std;
void main()
{
cout<<setfill('x')<<setw(10);
cout<<"Hello"<<endl;
}
第8题:
( 20 )已知数组 arr 的定义如下:
int arr[5] = {1,2,3,4,5};
下列语句中输出结果不是 2 的是
A ) cout << *arr+1 <<endl;
B ) cout << *(arr+1)<<endl;
C ) cout << arr[1] <<endl;
D ) cout << *arr <<endl;
第9题:
下列程序的执行结果是______。
include<iostream.h>
include<iomanip.h>
using namespace std;
voidmain()
{
cout<<setfill('x')<<setw(10);
cout<<"Hello"<<end1;
}
第10题:
下列实现C语言语句printf("Hello!")的相同功能的语句是( )。
A.cout>>"Hello!"
B.cin>>"Hello!"
C.cout<<"Hello!"
D.cin<<"Hello!"