niusouti.com

下面程序的执行结果是【】。 include include using namespace std; void main(下面程序的执行结果是【 】。include<iostream>include<iomanip>using namespace std;void main(){cout<<setfill('x')<<setw(10);cout<<"Hello"<<endl;}

题目
下面程序的执行结果是【】。 include include using namespace std; void main(

下面程序的执行结果是【 】。

include<iostream>

include<iomanip>

using namespace std;

void main()

{

cout<<setfill('x')<<setw(10);

cout<<"Hello"<<endl;

}


相似考题
更多“下面程序的执行结果是【】。 include<iostream> include<iomanip> using namespace std; void main( ”相关问题
  • 第1题:

    以下程序的执行结果是【】。 include include void pnnt(int n) { if (n!=0

    以下程序的执行结果是【 】。

    include<iostream.h>

    include<iomanip.h>

    void pnnt(int n)

    {

    if (n!=0)

    {

    Print(n-1);

    for (int i=1;i<=n;i++)

    cout<<setw(3)<<i;

    cout<<endl;

    }

    }

    void main()

    {

    print(4);

    }


    正确答案:1 12 123 1234
    1 12 123 1234

  • 第2题:

    以下程序的执行结果是______ include include void print(int n) { if(n

    以下程序的执行结果是______

    include<iostream.h>

    include<iomanip.h>

    void print(int n)

    {

    if(n!=0)

    {

    print(n-1);

    for(int i=1;i<=n;i++=

    cout<<setw(3)<<i;

    cout<<endl;

    }

    }

    void main()

    {

    print (4);

    }


    正确答案:1 1 2 1 2 3 1 2 3 4
    1 1 2 1 2 3 1 2 3 4

  • 第3题:

    有如下程序:include includeusing namespace std;int main(){cout.fill('*

    有如下程序:#include <iostream>#include<iomanip>using namespace std;int main(){ cout.fill('*'); cout.width(6); cout.fill('#'); cout<<123<<end1; return 0;}执行后的输出结果是( )。

    A.###123

    B.123###

    C.***123

    D.123***


    正确答案:A

  • 第4题:

    下列程序的执行结果是【 】。 include int a; int sum_a(void) { a=a+5; return a; }

    下列程序的执行结果是【 】。

    include <iostream. h>

    int a;

    int sum_a(void)

    {

    a=a+5;

    return a;

    }

    void main(void)

    {

    a = a+sum_a();

    cout<<a<<endl;

    }


    正确答案:10
    10 解析:本题考查全局变量的使用。全局变量被系统默认初始化为0,故在执行a=a+sum _a();语句时,首先执行sum_a函数,将a的值改变为5,该函数的返回值也是5,故最后a的值被赋值为10。

  • 第5题:

    有如下程序: include include using namespace std; int main() {cout.f

    有如下程序: #include <iostream> #include <iomanip> using namespace std; int main() { cout.fill('*'); cout.width(6); cout.fill('#'); cout<<123<<end1; return 0; } 执行生的输出结果是( )。

    A. ###123

    B.123###

    C. ***123

    D.123***


    正确答案:A