跳到正文

个人记录

[题解] 放大打印机

SpriteQAQ约 1 分钟
原文
文章信息与版本

文章信息

发布
2024年8月17日
收录
2025年12月12日
更新
2026年11月14日
篇幅
约 1 分钟
获赞
1

版本

  1. v3当前
  2. v2
  3. v1
C++
/*
最美の四重循环
*/
#include <bits/stdc++.h>
using namespace std;
int main(){
	int x, y, nx, ny;
	cin >> x >> y >> nx >> ny;
	char s[55][55];
	for (int i = 1; i <= x; i++){
		for (int j = 1; j <= y; j++){
			cin >> s[i][j];
		}
	}
	for (int i = 1; i <= x; i++){
		for (int j = 1; j <= nx; j++){
			for (int k = 1; k <= y; k++){
				for (int l = 1; l <= ny; l++){
					cout << s[i][k];
				}
			}
			if (j != nx) cout << endl; 
		}
		if (i != x) cout << endl;
	}
	return 0;
} 
原文
存档评论8 条抓取于