[蓝桥杯]基础练习 字母图形

在这里插入图片描述
在这里插入图片描述

在这里插入图片描述

#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;
} 

在这里插入图片描述

发布了192 篇原创文章 · 获赞 5 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/qq_40691051/article/details/104534561
今日推荐