- 【例37.3】 菱形图形
dhf9iurehjhigjhitygkjbhigfkjbigjnkhjnoyjpou;pjpju
- 2025-1-14 14:22:16 @
#include<bits/stdc++.h> using namespace std; int n,m,a,b; int main(){ cin>>n>>m>>a>>b; if(b0){ for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ if(i1||in||j1||j==m){ cout<<a; }else{ cout<<" "; } } printf("\n"); } }else{ for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cout<<a; } printf("\n"); } } return 0; }
4 comments
-
张景 LV 7 @ 2025-1-14 14:28:43
#include<bits/stdc++.h> using namespace std; int main() { int n,m,x; char ch; cin>>n>>m>>ch>>x; if(x==0) { for(int i=0; i<n; i++) { for(int j=0; j<m; j++) { if(i==0||i==n-1||j==0||j==m-1) { cout<<ch; } else { cout<<" "; } } cout<<endl; } } else { for(int i=0; i<n; i++) { for(int j=0; j<m; j++) { cout<<ch; } cout<<endl; } } return 0; }
-
2025-1-14 14:28:05@
#include<bits/stdc++.h> using namespace std; int n,m,a,b; int main(){ cin>>n>>m>>a>>b; if(b0){ for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ if(i1||in||j1||j==m){ cout<<a; }else{ cout<<" "; } } printf("\n"); } }else{ for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cout<<a; } printf("\n"); } } return 0; }
-
2025-1-14 14:27:53@
你个*********
-
2025-1-14 14:25:31@
听好了乡巴老
- 1
Information
- ID
- 139
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 8
- Tags
- # Submissions
- 96
- Accepted
- 18
- Uploaded By