码迷,mamicode.com
首页 > 其他好文 > 详细

打印正方形

时间:2019-03-11 18:54:42      阅读:231      评论:0      收藏:0      [点我收藏+]

标签:out   int   namespace   class   std   输出   str   using   main   

题目描述

打印正方形

输入描述

输入一个整数n,1<=n<=100

输出描述

输出一个有字符‘*‘构成的实心正方形

样例输入

5

样例输出

*****
*****
*****
*****
*****
#include <iostream>
using namespace std;
int main()
{
    int n,s,m;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        for(int j=0;j<n;j++)
        {
            cout<<"*";
        }
        cout<<endl;
    }
}

 

打印正方形

标签:out   int   namespace   class   std   输出   str   using   main   

原文地址:https://www.cnblogs.com/palx/p/10512375.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!