Xavistian

Banderas Función

May 28th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.00 KB | None | 0 0
  1. // ConsoleApplication2.cpp : main project file.
  2.  
  3. // ConsoleApplication1.cpp : main project file.
  4.  
  5. #include "stdafx.h"
  6. #include <conio.h>
  7. #include <iostream>
  8. using namespace std;
  9. using namespace System;
  10.  
  11. void DibujaBandera(int Matriz[][7])
  12. {
  13.     Console::BackgroundColor = ConsoleColor::White;
  14.     Console::ForegroundColor = ConsoleColor::Blue;
  15.     for (int i = 0; i < 3; i++)
  16.     {
  17.         for (int j = 0; j < 7; j++)
  18.         {
  19.             if (Matriz[i][j] == 1) cout << (char)219;
  20.             else cout << ' ';
  21.         }cout << endl;
  22.     }
  23. }
  24. int main()
  25. {
  26.     int Matriz1[3][7] = { { 0,0,1,0,0,0,0 },{ 1,1,1,1,1,1,1 },{ 0,0,1,0,0,0,0 }};
  27.     int Matriz2[3][7] = { {1,1,1,1,1,1,1},{0,0,0,0,0,0,0},{1,1,1,1,1,1,1}};
  28.     int Matriz3[3][7] = { {1,1,0,0,0,1,1},{1,1,0,0,0,1,1},{1,1,0,0,0,1,1} };
  29.     DibujaBandera(Matriz1);
  30.     _getch();
  31.     Console::BackgroundColor = ConsoleColor::Black;
  32.     Console::Clear();
  33.     DibujaBandera(Matriz2);
  34.     _getch();
  35.     Console::BackgroundColor = ConsoleColor::Black;
  36.     Console::Clear();
  37.     DibujaBandera(Matriz3);
  38.     _getch();
  39.     return 0;
  40. }
Add Comment
Please, Sign In to add comment