12 solutions

  • 1
    @ 2026-11-18 18:44:09
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
        int m,n,q;
    	char w;
    	cin>>m>>n>>w>>q;
    	if(q==1)
    	{
            for(int i=1;i<=m;i++)
    	    {
    		    for(int j=1;j<=n;j++)
    		    {
    		        cout<<w;
    		    }
    			cout<<endl;
    	    }
    	}
    	if(q==0)
    	{
    		for(int i=1;i<=m;i++)
    	    {
    		    for(int j=1;j<=n;j++)
    		    {
    		        if(i==1||i==m||j==1||j==n)
    				{
    					cout<<w;
    				}
    				else
    				{
    					cout<<" ";
    				}
    		    }
    			cout<<endl;
    	    }
    	}
    	return 0; 
    }
    
    • 1
      @ 2026-8-11 15:44:48
      #include<bits/stdc++.h>
      using namespace std;
      int main()
      {
          int a,b;
      	char c;
      	bool d;
      	cin>>a>>b>>c>>d;
      	if(d==1)
      	{
      		for(int i=1;i<=a;i++)
      		{
      			for(int j=1;j<=b;j++)
      			{
      				cout<<c;
      			}
      			cout<<endl;
      		}  
      	}
      	else
      	{
      		for(int i=1;i<=a;i++)
      		{
      			for(int j=1;j<=b;j++)
      			{
      				if(i==1||i==a||j==1||j==b)
      				{
      					cout<<c;
      				}
      				else
      				{
      					cout<<" ";
      				}
      			}
      			cout<<endl;
      		}
      	}
      	return 0; 
      }
      
      • 1
        @ 2026-8-11 15:14:42
        #include<bits/stdc++.h>
        using namespace std;
        int main()
        {
        	int n,m;
        	char c;
        	int d;
        	cin>>n>>m>>c>>d;
        	if(d==0)
        	{
        		for(int i=1;i<=n;i++)
        		{
        			for(int j=1;j<=m;j++)
        			{
        				if(i==1||i==n||j==1||j==m)
        				{
        					cout<<c;
        				}
        				else
        				{
        					cout<<" ";
        				}
        			}
        			cout<<endl;
        		}
        	}
        	else
        	{
        		for(int i=1;i<=n;i++)
        		{
        			for(int j=1;j<=m;j++)
        			{
        				cout<<c;
        			}
        			cout<<endl;
        		}
        	}
        	return 0;
        }
        
        
        • -2
          @ 2026-2-6 10:24:57
          #include<bits/stdc++.h>
          using namespace std;
          int main()
          {
              int a,b,d;
              char c;
              cin>>a>>b>>c>>d;
              for(int i=1;i<=a;i++)
              {
                  for(int j=1;j<=b;j++)
                  {
                      if(i==1 || i==a || j==1 || j==b)
                      {
                          cout<<c;
                      }
                      else if(d==0)
                      {
                          cout<<" ";
                      }
                      else
                      {
                          cout<<c;
                      }    
                      
                  }
                  cout<<endl;
              }
              return 0;
          }
          
          • -2
            @ 2024-11-4 19:36:09
            #include<bits/stdc++.h>
            using namespace std;
            int main()
            {
                int n,a;
                char b;
                bool c;
                cin>>n>>a>>b>>c;
                if( c == 1)
                {
                    for(int i = 1;i <= n;i++)
                    {
                        for(int j = 1;j <= a;j++)
                        {
                            cout<<b;
                        }
                        cout<<endl;
            
                    }
                }
                if(c == 0)
                {
                    for(int i = 1;i <= n;i++)
                    {
                        for(int j = 1;j <= a;j++)
                        {
                            if(i == n || i == 1 || j == a || j == 1)
                            {
                                cout<<b;
                            }
                            else
                            {
                                cout<<" ";
                            }
                
                        }
                        cout<<endl;
                    }
                }
                return 0;
            }
            
            • -5
              @ 2024-7-9 10:06:19
              #include<bits/stdc++.h>
              using namespace std;
              int main()
              {
                  int a,b,t;
                  char n; 
                  cin>>a>>b>>n>>t;
                  if(t==1)
                  {
                      for(int i=1;i<=a;i++)
                      {
                          for(int j=1;j<=b;j++)
                          {
                              cout<<n;
                          }
                          cout<<endl;
                      }
                  }
                  else if(t==0)
                  {
                      for(int i=1;i<=a;i++)
                      {
                          if(i==1)
                          {
                              for(int j=1;j<=b;j++)
                              {
                                  cout<<n;
                              }
                          }
                          else if(i>1 && i<a)
                          {
                              cout<<n;
                              for(int j=1;j<+b-1;j++)
                              {
                                  cout<<" ";
                              }
                              cout<<n;
                          }
                          else if(i==a)
                          {
                              for(int j=1;j<=b;j++)
                              {
                                  cout<<n;
                              }
                          }
                          cout<<endl;
                      }
                  }
                  return 0;
              }
              
              • -5
                @ 2024-6-14 20:22:38

                #include<bits/stdc++.h> using namespace std; int main() { int n,m,g; char v; cin>>n>>m>>v>>g; if(g0) { for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { if(in||i1||jm||j==1) { cout<<v; } else { cout<<" ";

                }	
                		}
                		cout<<endl;
                	}
                }
                else if(g==1)
                {
                	for(int i=1;i<=n;i++)
                	{
                    	for(int j=1;j<=m;j++)
                    	{
                       		cout<<v;
                    	}
                    	cout<<endl;
                	}
                }
                
                
                
                return 0;
                

                }

                • -5
                  @ 2024-6-14 20:20:22

                  #include<bits/stdc++.h> using namespace std; int main() { int n,m,g; char v; cin>>n>>m>>v>>g; if(g0) { for(int i=1;i<=n;i++) { for(int j=1;j<=m;j++) { if(in||i1||jm||j==1) { cout<<v; } else { cout<<" ";

                  }	
                  		}
                  		cout<<endl;
                  	}
                  }
                  else if(g==1)
                  {
                  	for(int i=1;i<=n;i++)
                  	{
                      	for(int j=1;j<=m;j++)
                      	{
                         		cout<<v;
                      	}
                      	cout<<endl;
                  	}
                  }
                  
                  
                  
                  return 0;
                  

                  }

                  • -5
                    @ 2024-5-25 11:05:35
                    #include<bits/stdc++.h>
                    using namespace std;
                    int main()
                    {
                    	int a,b;
                    	char c;
                    	bool d;
                    	cin>>a>>b>>c>>d;
                    	if(d==1)
                    	{
                    		for(int i=1;i<=a;i++)
                    		{
                    			for(int j=1;j<=b;j++)
                    			{
                    				cout<<c;
                    			}
                    			cout<<endl;
                    		}
                    	}
                    	if(d==0)
                    	{
                    		for(int i=1;i<=a;i++)
                    		{
                    			for(int j=1;j<=b;j++)
                    			{
                    				if(i==1||i==a||j==1||j==b)
                    				{
                    					cout<<c;
                    				}
                    				else 
                    				{
                    					cout<<" ";
                    				}
                    			}
                    			cout<<endl;
                    		}
                    	}
                        return 0;
                    }
                    
                    • -6
                      @ 2024-10-26 9:15:38

                      不会做不要看题解

                    • -6
                      @ 2024-10-26 9:13:01

                      不会做不要看题解

                      • @ 2024-11-4 19:15:43

                        你个二级的别猪叫了!

                    • -6
                      @ 2024-6-14 19:57:47
                      #include<bits/stdc++.h>
                      using namespace std;
                      int main()
                      {
                      	int a,b;
                      	char c;
                      	bool d;
                      	cin>>a>>b>>c>>d;
                      	if(d==1)
                      	{
                      		for(int i=1;i<=a;i++)
                      		{
                      			for(int j=1;j<=b;j++)
                      			{
                      				cout<<c;
                      			}
                      			cout<<endl;
                      		}
                      	}
                      	if(d==0)
                      	{
                      		for(int i=1;i<=a;i++)
                      		{
                      			for(int j=1;j<=b;j++)
                      			{
                      				if(i==1||i==a||j==1||j==b) //边缘判断 
                      				{	
                      					cout<<c;
                      				}
                      				else
                      				{
                      					cout<<" ";
                      				}
                      			}
                      			cout<<endl;
                      		}
                      	}
                      	return 0;
                      }
                      
                      • 1

                      Information

                      ID
                      885
                      Time
                      1000ms
                      Memory
                      256MiB
                      Difficulty
                      1
                      Tags
                      (None)
                      # Submissions
                      244
                      Accepted
                      93
                      Uploaded By