0分,求助!
  • 板块B2083 画矩形
  • 楼主banglee
  • 当前回复5
  • 已保存回复5
  • 发布时间2022/6/11 21:28
  • 上次更新2023/10/27 23:30:41
查看原帖
0分,求助!
681292
banglee楼主2022/6/11 21:28
#include<iostream>
using namespace std;
int main(){
    int a,b,f;
    char c;
    cin>>a>>b>>c>>f;
    if(f==1)
    {
        for(int i=0;i<a;i++)
        {
            for(int j=0;j<b;j++)
                cout<<c;
            cout<<endl;
        }
    }
    else
    {
        for(int i=0;i<a;i++)
        {
            if(i==0||i==a-1)
                for(int j=0;j<b;j++)
                    cout<<c;
            else
                for(int j=0;j<b-2;j++)
                    cout<<" ";
            cout<<endl;
        }
    }
    return 0;
}
2022/6/11 21:28
加载中...