9 solutions
-
6
#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; }
-
0
#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; }
-
-1
#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; }
-
-2
#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; }
-
-2
#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;
}
-
-2
#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;
}
-
-2
#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
- 107
- Accepted
- 45
- Uploaded By