#include #include void fFeel(int aMatrix[20][20]) { for (int x = 0; x < 20; x++) { for (int y = 0; y < 20; y++) { aMatrix[x][y] = 0; } } } void fPrint(int aMatrix[20][20]) { //std::system("CLS"); for (int x = 0; x < 20; x++) { for (int y = 0; y < 20; y++) { std::cout << aMatrix[x][y] << " "; } std::cout << "\r\n"; } } void fPoint(int dx, int dy, int aMatrix[20][20]) { int k = 0; int val = 0; aMatrix[dx][dy] = 9; for (int x = 0; x < 20; x++) { for (int y = 0; y < 20; y++) { if (!((dx == x) && (dy == y))) { aMatrix[x][y] = floor( 9 - std::sqrt(((dx - x) * (dx - x)) + ((dy - y) * (dy - y)))); if (aMatrix[x][y] < 0) { aMatrix[x][y] = 0; } } } } } int main() { int aMatrix[20][20] = {}; fFeel(aMatrix); fPoint(4, 6, aMatrix); fPrint(aMatrix); }