题目:
C++代码:
#include<iostream>
#include<vector>
#include<stdlib.h>
#include<stdio.h>
#include<string>
#include<cstring>
#include<algorithm>
using namespace std;
int main()
{
int n, m;
cin >> n >> m;
int i, j, k;
if (m == 0 || n == 0)
return 0;
for (i = 1; i <=2*n+1; i++)
{
if (i % 2 != 0)
{
for (j = 1; j <=2*m+1; j++)
{
if (j % 2 != 0)
cout << "+";
else
cout << "-";
}
}
else
{
for (k = 1; k <= 2 * m + 1; k++)
{
if (k % 2 != 0)
cout << "|";
else
cout << " ";
}
}
cout << endl;
}
return 0;
}
``