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
c语言新手 求大神帮忙
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
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