20分,求调,TLE
查看原帖
20分,求调,TLE
907177
zhenghao20220503楼主2024/10/21 12:24
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long a,b,x;
	char ch;
	cin>>a>>b>>ch>>x;
	
	if(x==1) 
	{
		for(int i=1;i<=a;i++)
		{
			for(int j=1;i<=b;j++)
			{
				cout<<ch; 
			}
			cout<<endl;
		 } 
	}
	else if(x==0) 
	{
		for(int i=0;i<b;i++) 
		{
			cout<<ch;
		}
        cout<<endl;
        for(int i=0;i<a-2;i++)
		{
            cout<<ch;
            for(int j=0;j<b-2;j++) 
			{
				cout<<' ';
			}
            cout<<ch<<endl;
        }
        for(int i=0;i<b;i++)
		{
			cout<<ch;
		 } 
	}
	else 
	{
		for(int i=1;i<=a;i++)
		{
			for(int j=1;i<=b;j++)
			{
				cout<<ch; 
			}
			cout<<endl;
		 } 
	}
	return 0;
}

2024/10/21 12:24
加载中...