Advertisement
Emanuele_Bruno

scacchiera

Nov 18th, 2015
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.44 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     bool casella, scacchiera[8][8];
  8.     int i=0,j;
  9.     while (i<8)
  10.     {
  11.         if (i%2) casella=true;
  12.         else casella=false;
  13.         j=0;
  14.         while (j<8)
  15.         {
  16.             scacchiera[i][j]=casella;
  17.             cout << scacchiera[i][j];
  18.             casella=!casella;
  19.             j++;
  20.         }
  21.         cout << "\n";
  22.         i++;
  23.     }
  24.     return 0;
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement