Problem Description
Using letters to make some beautiful graphics, here's an example:
ABCDEFG
Babcdef
Cbabcde
Dcbabcd
Edcbabc
This is a 5 row 7-column graph, find out the pattern of the graph, and output an n-row m-column graph.
Input Format
Enter a row that contains two integers n and m, representing the number of columns of the number of rows of the graph you want to output.
output Format
Output n lines, each m characters, for your graphics.
Sample Input
5 7
Sample output
ABCDEFG
Babcdef
Cbabcde
Dcbabcd
Edcbabc
data size and conventions
1 <= N, M <= 26.
The C + + code is as follows:
#include <iostream>
#include <cmath>
using namespace std;
int main ()
{
intn; N is the row
Intm; M is column
cin>>n>>m;
Chara= ' A '; As output cardinality for
(inti=0;i<n;i++)
{for
(intj=0;j<m;j++)
{
cout<< char (A+abs (i-j ));
}
cout<<endl;
}
Return0;
}