语句cout <<setprecison (3)<<3.1415926<<end1;的输出为( )。
A.3.14
B.3.1
C.3.142
D.3.141
第1题:
阅读下面程序: #include <iomanip. h> int main () { cout<<setfill( '*' )<<setw( 8 ); cout<<setprecision( 5 )<<3.1415926<<end1; return 0; } 则该程序的输出结果是 ( )。
A.3.1415**
B.***3.1416
C.3.141593
D.**3.14159
第2题:
执行下列程序语句后,输出结果为( )。 #inelude<iostream> using namespace std; int m=5; int main() { int m=3; m++; ::m++; cout<<m<<end1; return 0; }
A.3
B.4
C.5
D.6
第3题:
语句cout<<setfill("")<<setw(4)<<setfill('i')<<setw(7)<<'m'<<end1;的输出结果为( )。
A.iiiimmmmnmm
B.iiiimmmmmm
C.iiiimmm
D.iiiiimm
第4题:
语句cout<<setprecision (3)<<3.1415926<<end1;的输出为【 】。
第5题:
执行下列语句: #include<iostream> using namespace std; int main() { int x=3; if(x=5) cout<<x++<<end1; else cout<<x<<end1; return 0; } 程序的输出是( )。
A.3
B.4
C.5
D.6
第6题:
执行“cout.<<char(‘F’,-2)<<end 1;”语句后得到的输出结果为【 】。
第7题:
语句cout<<setiosflags(ios::showpos)<<38<<""<<-38<<end1;的输出结果为【 】。
第8题:
执行下列语句段后程序的输出结果是______。
int x[]={1,2,3,4,5};
int q=x;
cout<<*(++q)<<end1;
第9题:
执行以下程序,输出结果的最后一行语句是______。
include <iostream.h>
class Sample
{
int x,y;
public:
Sample(){x=y=0;}
Sample(int a,int b){x=a;y=b;}
~Sample()
{
if(x==y)
cout<<"x!=y"<<end1;
else
cout<<"x!=y"<<end1;
}
void disp()
{
cout<<"x="<<x<<",y="<<y<<end1;
}
};
void main()
{
Sample s1(2,3);
s1.disp();
}