用c语言在屏幕上输入3排6星******,只用printf(“*”)循环语句

如题所述

#include <stdio.h>

int main()
{
 int i,j;

 for(i=0;i<3;i++)
    {
        for(j=0;j<6;j++)
            printf("*");
        printf("\n");
    }

 return 0;
}

请采纳。

温馨提示:答案为网友推荐,仅供参考
第1个回答  2016-03-22
这个简单
#include<stdio.h>
main()
{
int i;
for(i=0;i<18;i++)
{
printf("*");
if(i%6==0)printf("\n");
}
getch();

}本回答被网友采纳
第2个回答  2016-03-22
#include <stdio.h>
void main()
{
    int row=3, col=6;
    int i,j;
    for( i=0; i<row; i++ ) //循环输出row行
    {
        for( j=0;j<col;j++ ) //循环输出col个*
            printf("*");
        printf("\n"); //输出一行后,进行换行
    }
}

第3个回答  2016-03-22
for(int i=0;i<6;i++){
printf(“******”)
}
第4个回答  2016-03-22
第5个回答  2016-03-22

相关了解……

你可能感兴趣的内容

本站内容来自于网友发表,不代表本站立场,仅表示其个人看法,不对其真实性、正确性、有效性作任何的担保
相关事宜请发邮件给我们
© 非常风气网