weixin_31090855 2015-09-30 05:45 采纳率: 28.6%
浏览 1506
已结题

c语言新手 求大神帮忙

Asterisk printing1
• Write a program that outputs a triangle with a '*' character
• Input the Height repeatedly using the While statement
• Output a '*' character using the For statement图片说明

  • 写回答

5条回答 默认 最新

  • 佳乐_z 2015-09-30 06:31
    关注

    int height;
    while( true )
    {
    printf("Height: ");
    if( 1 == scanf("%d",&height) )
    {
    for( int i = 0;i < height;++i)
    {
    for(int j = 0; j <= i;++j)
    printf("*");
    printf("\n");
    }
    printf(">>>=====================RESTART=====================");
    }
    else
    fflush(stdin);
    }

    评论

报告相同问题?

悬赏问题

  • ¥15 怎么获取下面的: glove_word2id.json和 glove_numpy.npy 这两个文件
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug