c语言中绘制长方形

 

#include <stdio.h>

int main(void)
{
    int i, j, m, n;
    puts("please input two integers.");
    printf("m = "); scanf("%d", &m);
    printf("n = "); scanf("%d", &n);
    
    for (i = 1; i <= m; i ++ )
    {
        for (j = 1; j <= n; j ++ )
        {
            putchar('*');
        }
        putchar('\n');
    }
    return 0;
}

 

posted @ 2021-01-07 19:09  小鲨鱼2018  阅读(1489)  评论(0编辑  收藏  举报