fork(3) download
  1. #include <iostream>
  2. #include <cmath>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. float Fx = 4, Fy = 5;
  8. int x, y, m[7][7];
  9. cin >> x >> y;
  10.  
  11. for (x = 0; x < 7; x++)
  12. for (y = 0; y < 7; y++)
  13. if (x == Fx || y == Fy || abs(x - Fx) == abs(y - Fy))
  14. m[x][y] = 1;
  15. else
  16. m[x][y] = 0;
  17.  
  18. for(x = 0; x < 7; x++)
  19. for(y = 0; y < 7; y++)
  20. cout << m[x][y];
  21. return 0;
  22. }
Success #stdin #stdout 0s 2688KB
stdin
1
2
stdout
0100010001001000010100000111111111100001110001010