Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <stdlib.h>
- #include <string>
- using namespace std;
- /*
- +------------------------+
- |O.O.O.#.#.#.#.#.#.#.#.|D|)
- |O.O.O.#.#.#.#.#.#.#.#.|.|
- |O.......................|
- |O.O.#.#.#.#.#.#.#.#.#.|.|)
- +------------------------+
- */
- void doStuff(char A[11][4], int &k) {
- for (int i = 0; i < 11; i++) {
- for (int j = 3; j >= 0; j--) {
- if (A[i][j] == '#' && k != 0) {
- A[i][j] = 'O';
- k--;
- }
- }
- }
- }
- void printBus(char A[11][4]) {
- for (int j = 3; j >= 0; j--) {
- // +------------------------+
- if (j == 3) {
- for (int l = 0; l < 26; l++) {
- if (l == 0 || l == 25) {
- cout << "+";
- continue;
- }
- cout << "-";
- }
- cout << endl;
- }
- for (int i = 0; i <= 11; i++) {
- if (i == 11) {
- switch (j) {
- case 0: cout << "|.|)"; break;
- case 1: cout << "..|"; break;
- case 2: cout << "|.|"; break;
- case 3: cout << "|D|)"; break;
- }
- continue;
- }
- if (i == 0) {
- cout << "|";
- }
- cout << A[i][j] << '.';
- }
- cout << endl;
- // +------------------------+
- if (j == 0) {
- for (int l = 0; l < 26; l++) {
- if (l == 0 || l == 25) {
- cout << "+";
- continue;
- }
- cout << "-";
- }
- //cout << endl;
- }
- }
- }
- int main() {
- system("COLOR F0");
- int k(0);
- cin >> k;
- char A[11][4] = {
- {'#', '#', '#', '#'},
- {'#', '.', '#', '#'},
- {'#', '.', '#', '#'},
- {'#', '.', '#', '#'},
- {'#', '.', '#', '#'},
- {'#', '.', '#', '#'},
- {'#', '.', '#', '#'},
- {'#', '.', '#', '#'},
- {'#', '.', '#', '#'},
- {'#', '.', '#', '#'},
- {'#', '.', '#', '#'}
- };
- doStuff(A, k);
- printBus(A);
- //system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement