- 【例37.3】 菱形图形
tj
- 2025-1-14 14:28:11 @
#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;
}
0 comments
No comments so far...
Information
- ID
- 139
- Time
- 1000ms
- Memory
- 256MiB
- Difficulty
- 8
- Tags
- # Submissions
- 96
- Accepted
- 18
- Uploaded By