View Code of Problem 3926

#include<iostream>
#include<string>
#include<algorithm>
#include<stack>

using namespace std;

//借鉴ajh666大佬

int main() {
	int n, m, a, b;
	cin >> n >> m >> a >> b;
	char arr[20][20];
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			cin >> arr[i][j];
	for (int i = 0; i < n; i++)//遍历行
		for (int k = 0; k < a; k++)//行放大a倍(若要放大行,则行不变,重复列的放大操作)
		{
			for (int j = 0; j < m; j++)//遍历列
				for (int s = 0; s < b; s++)//列放大b倍
					cout << arr[i][j];
			cout << endl;//输出完每行后换行
		}
	return 0;
}

Double click to view unformatted code.


Back to problem 3926