7 条题解

  • 0
    @ 2024-8-20 17:22:56

    #include using namespace std; int main() { int a,b; char ch; bool x; int i,j;

    cin>>a>>b;
    cin>>ch;
    cin>>x;
    
    if(x)
    {
        for(i=1; i<=a; i++)
        {
            for(j=1; j<=b; j++)   cout<<ch;
            cout<<endl;
        }
    }
    else
    {
        for(i=1; i<=a; i++)
        {
            for(j=1; j<=b; j++)
            {
                if((i==1)||(i==a)||(j==1)||(j==b))//四条边均按条件输出
                    cout<<ch;
                else
                    cout<<" ";
            }
            cout<<endl;
        }
    }
    cout<<endl;
    return 0;
    

    }

    • 0
      @ 2024-7-20 13:38:28
      #include <iostream>
      using namespace std;
      int main()
      {
          int a,b;
          char ch;
          bool x;
          int i,j;
       
          cin>>a>>b;//行、列
          cin>>ch;//填充符号
          cin>>x;//空心或实心
       
          if(x)//实心
          {
              for(i=1; i<=a; i++)
              {
                  for(j=1; j<=b; j++)   cout<<ch;
                  cout<<endl;
              }
          }
          else//空心
          {
              for(i=1; i<=a; i++)
              {
                  for(j=1; j<=b; j++)
                  {
                      if((i==1)||(i==a)||(j==1)||(j==b))//四条边均按条件输出
                          cout<<ch;
                      else
                          cout<<" ";
                  }
                  cout<<endl;
              }
          }
          cout<<endl;
          return 0;
      }
      
      • 0
        @ 2024-7-16 10:47:05

        #include<bits/stdc++.h> using namespace std; int main(){ double a; cin>>a; if(a<=150)printf("%.1lf",0.4463a); if(a<=400 and a>150)printf("%.1lf",0.4663(a-150)+0.4463150); if(a>400)printf("%.1lf",0.5663(a-400)+0.4463150+0.4663250); return 0;

        • 0
          @ 2024-6-15 22:05:02
          #include<bits/stdc++.h>
          using namespace std;
          int main(){
              int a,b,w;
              char c;
              int d;
              cin>>a>>b>>c>>d;
              if(d==1){
                  for(int i=1;i<=a*b;i++){
                      cout<<c;
                      if(i==b){
                          cout<<endl;
                      }
                  }
              }
              w=b-2;
              if(d==0){
                  for(int j=1;j<2;j++){
                      cout<<c<<endl;
                  }
                  for(int k=1;k<=a-2;k++){
                      cout<<c;
                      for(int g=1;g<=w;g++){
                          cout<<" ";
                      }
                      cout<<c;
                  }
                  for(int j=1;j<2;j++){
                      cout<<c<<endl;
                  }
              }
          }
          
          • 0
            @ 2024-5-17 14:11:08

            #include<bits/stdc++.h> using namespace std; int main(){ int c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z; char a,b; cin>>c>>d>>a>>e; for(f=1;f<=c;f++){ for(g=1;g<=d;g++){ if(e1){ printf("%c",a); } if(e0){ if(f1 or fc or g1 or gd){ printf("%c",a); } else{ cout<<" "; } } } cout<<endl; } return 0; }

            • -7
              @ 2024-3-15 17:20:11
              #include<bits/stdc++.h>
              using namespace std;
              int main(){
                  double a;
                  cin>>a;
                  if(a<=150)printf("%.1lf",0.4463*a);
                  if(a<=400 and a>150)printf("%.1lf",0.4663*(a-150)+0.4463*150);
                  if(a>400)printf("%.1lf",0.5663*(a-400)+0.4463*150+0.4663*250);
                  return 0;
              
              • 1

              信息

              ID
              1262
              时间
              1000ms
              内存
              128MiB
              难度
              6
              标签
              (无)
              递交数
              228
              已通过
              63
              上传者