fojtasd

Untitled

Dec 14th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.97 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. #define m 5
  6.  
  7. bool clear() //vycisti pole a nastavi hodnoty na false
  8. {
  9.    
  10.     bool A[m][m] = {};
  11.     int row, column = 0;
  12.    
  13.     for (row=0; row < m; row++)
  14.     {
  15.         A[row][column] = 0;
  16.        
  17.         for (column=0; column < m-1; column++)
  18.         {
  19.             A[row][column] = 0;
  20.         }
  21.        
  22.     }
  23.  
  24.     return A[m][m];
  25. }
  26.  
  27.  
  28.  
  29. bool fill() //nastavi hodnoty true do obrazce
  30. {
  31.    
  32.     bool A[m][m] = {};
  33.     int row, column = 0;
  34.  
  35.     for (int row = 0; row < m; row++)
  36.     {
  37.         A[row][column] = 1;
  38.         for (int column = 0; column < m-1; column++)
  39.         {
  40.             A[row][column] = 1;
  41.         }
  42.     }
  43.        
  44.     return A[m][m];
  45. }
  46.  
  47. bool print()
  48. {
  49.     bool A[m][m] = {};
  50.     int row, column = 0;
  51.  
  52.     for (int row = 0; row < m; row++)
  53.     {
  54.         cout << A[row][column];
  55.         for (int column = 0; column < m - 1; column++)
  56.         {
  57.             cout << A[row][column];
  58.         }
  59.         cout << endl;
  60.     }
  61.     return A[m][m];
  62. }
  63.  
  64.  
  65.  
  66.  
  67.  
  68. int main()
  69. {
  70.     clear();
  71.     fill();
  72.     print();
  73.    
  74.    
  75.    
  76.  
  77.  
  78.  
  79.  
  80.  
  81.     system("pause");
  82.     return 0;
  83.    
  84. }
Advertisement
Add Comment
Please, Sign In to add comment