Untitled
unknown
c_cpp
2 years ago
568 B
3
Indexable
#include <iostream> #include <vector> #include <algorithm> int main() { int X, Y,X1,Y1,X2,Y2; std::cin >> X >> Y >> X1 >> Y1 >> X2 >> Y2; for (int y = 0; y < Y; y++) { for (int x = 0; x < X; x++) { if (y == 0 || y == Y - 1) { std::cout << "#"; } else if (x == 0 || x == X - 1) { std::cout << "#"; } else if (x == X1 - 1 && y == Y1 - 1) { std::cout << "$"; } else if (x == X2 - 1 && y == Y2 - 1) { std::cout << "*"; } else { std::cout << "."; } } std::cout << "\n"; } }
Editor is loading...
Leave a Comment