View Code of Problem 3926

#include<iostream>
using namespace std;
int main(){
	char ar[105][105];
	char p[105][105];
	int n,m,a,b;
	cin>>n>>m>>a>>b;
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			cin>>ar[i][j];
		}
	}
	for(int i=0;i<n*a;i++){
		for(int j=0;j<m*b;j++){
			p[i][j]=ar[i/a][j/b];
		}
	}
	for(int i=0;i<n*a;i++){
		for(int j=0;j<m*b;j++){
			cout<<p[i][j];
		}
		cout<<endl;
	}
}

Double click to view unformatted code.


Back to problem 3926