/* * dd.cpp * * Copyright 2009 Contest team 23 * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. */ #include #include #include #include using namespace std; int main(int argc, char** argv) { char matrix[10][7][6]; strcpy(matrix[0][0], "+---+"); strcpy(matrix[0][1], "| |"); strcpy(matrix[0][2], "| |"); strcpy(matrix[0][3], "+ +"); strcpy(matrix[0][4], "| |"); strcpy(matrix[0][5], "| |"); strcpy(matrix[0][6], "+---+"); strcpy(matrix[1][0], " +"); strcpy(matrix[1][1], " |"); strcpy(matrix[1][2], " |"); strcpy(matrix[1][3], " +"); strcpy(matrix[1][4], " |"); strcpy(matrix[1][5], " |"); strcpy(matrix[1][6], " +"); strcpy(matrix[2][0], "+---+"); strcpy(matrix[2][1], " |"); strcpy(matrix[2][2], " |"); strcpy(matrix[2][3], "+---+"); strcpy(matrix[2][4], "| "); strcpy(matrix[2][5], "| "); strcpy(matrix[2][6], "+---+"); strcpy(matrix[3][0], "+---+"); strcpy(matrix[3][1], " |"); strcpy(matrix[3][2], " |"); strcpy(matrix[3][3], "+---+"); strcpy(matrix[3][4], " |"); strcpy(matrix[3][5], " |"); strcpy(matrix[3][6], "+---+"); strcpy(matrix[4][0], "+ +"); strcpy(matrix[4][1], "| |"); strcpy(matrix[4][2], "| |"); strcpy(matrix[4][3], "+---+"); strcpy(matrix[4][4], " |"); strcpy(matrix[4][5], " |"); strcpy(matrix[4][6], " +"); strcpy(matrix[5][0], "+---+"); strcpy(matrix[5][1], "| "); strcpy(matrix[5][2], "| "); strcpy(matrix[5][3], "+---+"); strcpy(matrix[5][4], " |"); strcpy(matrix[5][5], " |"); strcpy(matrix[5][6], "+---+"); strcpy(matrix[6][0], "+---+"); strcpy(matrix[6][1], "| "); strcpy(matrix[6][2], "| "); strcpy(matrix[6][3], "+---+"); strcpy(matrix[6][4], "| |"); strcpy(matrix[6][5], "| |"); strcpy(matrix[6][6], "+---+"); strcpy(matrix[7][0], "+---+"); strcpy(matrix[7][1], " |"); strcpy(matrix[7][2], " |"); strcpy(matrix[7][3], " +"); strcpy(matrix[7][4], " |"); strcpy(matrix[7][5], " |"); strcpy(matrix[7][6], " +"); strcpy(matrix[8][0], "+---+"); strcpy(matrix[8][1], "| |"); strcpy(matrix[8][2], "| |"); strcpy(matrix[8][3], "+---+"); strcpy(matrix[8][4], "| |"); strcpy(matrix[8][5], "| |"); strcpy(matrix[8][6], "+---+"); strcpy(matrix[9][0], "+---+"); strcpy(matrix[9][1], "| |"); strcpy(matrix[9][2], "| |"); strcpy(matrix[9][3], "+---+"); strcpy(matrix[9][4], " |"); strcpy(matrix[9][5], " |"); strcpy(matrix[9][6], "+---+"); char lineInput[6]; while (true) { cin.getline(lineInput, 6); if (strcmp(lineInput, "end") == 0) { break; } char *point = lineInput; int hour = atoi(point); point += 3; int minute = atoi(point); int digits[4]; digits[0] = hour / 10; digits[1] = hour % 10; digits[2] = minute / 10; digits[3] = minute % 10; for (int i = 0; i < 7; i++) { for (int j = 0; j < 4; j++) { int digit = digits[j]; cout << matrix[digit][i]; if ( j == 1 ) { if (( i == 2 ) or ( i == 4 )) { cout << " o "; } else { cout << " "; } } else { cout << " "; } } cout << "\n"; } cout << "\n\n"; } return 0; }