[蓝桥杯]基础练习 字母图形
程序员文章站
2022-05-11 22:28:03
...
#include<iostream>
#include<string>
using namespace std;
int main()
{
int n,m;
cin>>n>>m;
string str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string path = str.substr(0, m);
for(int i = 0; i < n; i++)
{
for(int j = 0; j < m; j++)
{
cout<<path[j];
}
cout<<endl;
path = str[i+1] + path;
}
return 0;
}