AndreyIshmanov

ho 40a

Nov 29th, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.42 KB | None | 0 0
  1. #include "stdafx.h"
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7.     int diag[8][8] = {0};
  8.     for (int i = 0; i < 8; i++)
  9.     {
  10.         for (int j = 0; j < 8; j++)
  11.         {
  12.             if (i == j)
  13.             {
  14.                 diag[i][j] = 1;
  15.             }
  16.         }
  17.     }
  18.     cout << endl;
  19.     for (int i = 0; i < 8; i++)
  20.     {
  21.         for (int j = 0; j < 8; j++)
  22.         {
  23.             cout << diag[i][j] << ' ';
  24.         }
  25.         cout << endl;
  26.     }
  27.     cout << endl;
  28.  
  29.     system("pause");
  30.     return 0;
  31. }
Advertisement
Add Comment
Please, Sign In to add comment