Untitled

mail@pastecode.io avatar
unknown
c_cpp
a year ago
1.0 kB
2
Indexable
Never
#include <iostream>
#include <string>
#include <cmath>
#include <stdlib.h>
using namespace std;

//решил
int main() {

	int a;
	int b;

	cout << "Enter the height" << "\n";
	cin >> a;
	
	cout << "Enter the Weight" << "\n";
	cin >> b;
	
	

	//ради экономии времени

	if (a == 0 or b == 0) {
	
		cout << " One of your components doesn't exist. Error_Code_Blutrys ";
		
		exit(0);

	} //Error_Code_Bluetrys

	if (a == 1 and b == 1) {

		cout << '#';

	}


	else {

		//Верхушка
		for (int i = 1; i < b+1; i++) {
			
			cout << '#';
			
		}
		cout << '\n';
		
		if (a != 1) {
			
			//середина
			

			for (int heim = 0; heim < a - 2; heim++ ) {
				
				cout << "#";
				for (int h = 0; h < b-2; h++) {
				
					cout << ".";
				}

				cout << '#' << '\n';
				
			
			}


			//низина
			for (int i2 = 1; i2 < b+1 ; i2++) {
			
				cout << "#";

			}
			cout << '\n';
			
			
		}
		
		


	}
}