search

Home  >  Q&A  >  body text

c++题目。两个小空填什么?不会

c++题目。两个小空填什么?不会

大家讲道理大家讲道理2773 days ago414

reply all(3)I'll reply

  • ringa_lee

    ringa_lee2017-04-17 14:41:35

    I remember this was an exam question for subject C in my freshman year

    reply
    0
  • 阿神

    阿神2017-04-17 14:41:35

    The first empty for( i=1;i<6;i++ )
    The second empty for( n=1;n<=11-2i;n++ )

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 14:41:35

    void main(void)
    {

    int i,n,j;
    for(i=1;i<6,i++)
    {
        for(j = 1;j<i;j++){
            cout<<" ";
        }
        for(j =0;j<11-2*i;j++){
            cout<<"*";
        }
        for(j = 1;j<i;j++){
            cout<<" ";
        }
        cout<<endl;
    }

    }

    Try it

    reply
    0
  • Cancelreply