Untitled
unknown
c_cpp
2 years ago
1.0 kB
10
Indexable
#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';
}
}
}
Editor is loading...