{"id":325052,"date":"2021-06-17T09:00:50","date_gmt":"2021-06-17T09:00:50","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=325052"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=325052","title":{"rendered":"\u00ab\u041c\u043e\u0440\u0441\u043a\u043e\u0439 \u0431\u043e\u0439\u00bb \u043d\u0430 Java \u0434\u043b\u044f \u043d\u043e\u0432\u0438\u0447\u043a\u043e\u0432. Level 1"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0442\u0435\u043c, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u0440 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 Java \u0438 \u0438\u0449\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u043c \u0437\u043d\u0430\u043d\u0438\u044f\u043c. \u041a\u043b\u0430\u0441\u0441\u043d\u043e, \u0447\u0442\u043e \u0432\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c &#171;\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435&#187; \u0434\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u043b\u043a\u0438\u0435 \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u0434\u0430\u0447\u0438, \u0445\u043e\u0442\u044f \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u0442\u043e\u0436\u0435 \u043d\u0438\u043a\u0443\u0434\u0430. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u0435\u043e\u0440\u0438\u044e \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439. \u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0431\u0441\u0443\u0434\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f &#171;\u0431\u0438\u0437\u043d\u0435\u0441&#187; \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u0438\u043b \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u043b\u0433\u0438\u0445 \u043f\u0435\u0440\u0435\u0433\u043e\u0432\u043e\u0440\u043e\u0432 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0438\u0433\u0440\u044b:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u041d\u0430\u0448 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0440\u0435\u0442\u0440\u043e\u0433\u0440\u0430\u0434\u043e\u043c, \u0438 \u043e\u043d \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0433\u043e \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u0423 \u0432\u0441\u0435\u0445 \u0441\u0432\u043e\u0438 \u043f\u0440\u0438\u0447\u0443\u0434\u044b, \u043d\u043e \u043b\u0430\u0434\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432 \u0438\u0433\u0440\u0435 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0438\u0433\u0440\u043e\u043a\u0438 &#171;\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f&#187; &#8212; \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 &#171;\u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442&#187; (\u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0432\u0432\u0435\u0441\u0442\u0438), \u043a\u0430\u043a\u0438\u0435 \u0443 \u043d\u0438\u0445 \u0438\u043c\u0435\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0451 \u043f\u043e\u043b\u0435 &#8212; \u043a\u0432\u0430\u0434\u0440\u0430\u0442 10\u044510 \u043a\u043b\u0435\u0442\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c \u0438\u0433\u0440\u043e\u043a\u0438 \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u0432\u043e\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u0438. \u041a\u0430\u043a \u0438 \u0432 &#171;\u0431\u0443\u043c\u0430\u0436\u043d\u043e\u0439&#187; \u0432\u0435\u0440\u0441\u0438\u0438 &#8212; \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c 4 \u043e\u0434\u043d\u043e\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0445 \u043a\u043e\u0440\u0430\u0431\u043b\u044f, 3 \u0434\u0432\u0443\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0445, 2 \u0442\u0440\u0435\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0445 \u0438 1 \u0447\u0435\u0442\u044b\u0440\u0451\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439. <\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0440\u0430\u0431\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438\u043b\u0438 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0433\u0440\u043e\u043a\u0438 \u043d\u0435 \u0432\u0438\u0434\u044f\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0438\u0433\u0440\u0430. \u041f\u0435\u0440\u0432\u044b\u0439 \u0438\u0433\u0440\u043e\u043a \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u044b\u0441\u0442\u0440\u0435\u043b, \u0441\u043e\u043e\u0431\u0449\u0430\u044f \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0439 \u0446\u0435\u043b\u0438 &#8212; \u043d\u043e\u043c\u0435\u0440 \u043a\u043b\u0435\u0442\u043a\u0438 \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438 \u043d\u043e\u043c\u0435\u0440 \u043a\u043b\u0435\u0442\u043a\u0438 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0443\u0434\u0430\u0447\u043d\u044b\u043c, \u0438 \u043e\u043d \u043f\u043e\u0440\u0430\u0437\u0438\u043b \u0446\u0435\u043b\u044c, \u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439. <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0438\u0433\u0440\u043e\u043a\u043e\u043c \u043a\u043b\u0435\u0442\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0440\u0430\u0431\u043b\u044c, \u0442\u043e, \u0435\u0441\u043b\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u043e\u0434\u043d\u043e\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439, \u0438\u0433\u0440\u043e\u043a &#171;\u0443\u0431\u0438\u043b&#187; \u043a\u043e\u0440\u0430\u0431\u043b\u044c, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043e\u0434\u043d\u043e\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439, \u0442\u043e \u0440\u0430\u043d\u0438\u043b. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0445\u043e\u0434 \u0441\u043d\u043e\u0432\u0430 \u0437\u0430 \u043f\u0435\u0440\u0432\u044b\u043c \u0438\u0433\u0440\u043e\u043a\u043e\u043c.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0435\u0441\u043b\u0438 \u0438\u0433\u0440\u043e\u043a \u043d\u0435 \u043f\u043e\u043f\u0430\u043b \u043d\u0438 \u0432 \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c, \u0442\u043e \u0445\u043e\u0434 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u0438\u0433\u0440\u043e\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043f\u0443\u043d\u043a\u0442\u0435 8, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0445\u043e\u0434 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0443, \u0438\u0433\u0440\u043e\u043a\u0438 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442\u044c \u043a\u043e\u0440\u0430\u0431\u043b\u0438 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430. \u0422\u043e\u0442, \u043a\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u043c, \u043e\u0434\u043e\u043b\u0435\u0435\u0442 \u0444\u043b\u043e\u0442\u0438\u043b\u0438\u044e \u0432\u0440\u0430\u0433\u0430 &#8212; \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044c. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u0432 \u0441 \u0431\u0438\u0437\u043d\u0435\u0441\u043e\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0433\u0440\u044b.<\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u043b\u044e\u0431\u043e\u043c Java \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441 (\u043d\u0435 \u0443\u043c\u0430\u043b\u044f\u044f \u043e\u0431\u0449\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u0435\u0433\u043e Main), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d, \u044f \u0434\u0443\u043c\u0430\u044e \u0443\u0436\u0435 \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439, \u043c\u0435\u0442\u043e\u0434 main.<\/p>\n<pre><code class=\"java\">public class Main { \tpublic static void main(String[] args) {   \t\/\/your code will be here \t} }<\/code><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e, \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0430\u0448\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438 &#171;\u0441\u0430\u043c\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 \u0441\u0432\u0435\u0442\u0435&#187; \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u041e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u043d\u0430 \u043f\u0443\u043d\u043a\u0442\u044b 1-3 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u043a\u0430\u043c \u0432\u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0438 \u0438\u043c\u0435\u043d\u0430. \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 java.util.Scanner, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043c\u0435\u0435\u0442 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. <\/p>\n<pre><code class=\"java\">public class Main {     static Scanner scanner = new Scanner(System.in);      public static void main(String[] args) {         System.out.println(\"Player 1, please, input your name\");         String player1Name = scanner.nextLine();         System.out.println(\"Hello, \" + player1Name + \"!\");          System.out.println(\"Player 2, please, input your name\");         String player2Name = scanner.nextLine();         System.out.println(\"Hello, \" + player2Name + \"!\");     } }<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u043e\u0434\u0435:<\/p>\n<p>\u0412 \u0441\u0442\u0440\u043e\u043a\u0435 2 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u0430 Main scanner.<\/p>\n<p>\u041d\u0435\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 nextLine() \u043a\u043b\u0430\u0441\u0441\u0430 Scanner (\u0441\u0442\u0440\u043e\u043a\u0438 6 \u0438 11) \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u043d \u0435\u0449\u0435 \u043d\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043b.    <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c &#8212; &#171;Hello, {username} !&#187;<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0431\u0443\u0434\u0435\u043c \u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u0434 \u0441\u0435\u0439\u0447\u0430\u0441.<\/p>\n<pre><code>Player 1, please, input your name Egor Hello, Egor! Player 2, please, input your name Max Hello, Max!<\/code><\/pre>\n<p>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u043e\u043b\u0435 \u0431\u043e\u044f \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f\u043c\u0438. \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u0447\u0442\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 char[][] buttlefield. \u0412 \u043d\u0435\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439. \u0414\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0443\u0434\u0430\u0447\u043d\u043e\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c #. \u041d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0439 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c *. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e, \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u0435\u0444\u043e\u043b\u0442\u043e\u0432\u044b\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430 char \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c (&#8216;\\u0000&#8217;), \u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u0433\u0440\u044b \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 # \u0438 *.<\/p>\n<pre><code class=\"java\">public class Main { \t\tstatic final int FILED_LENGTH = 10;     static Scanner scanner = new Scanner(System.in);  public static void main(String[] args) {     System.out.println(\"Player 1, please, input your name\");     String player1Name = scanner.nextLine();     System.out.println(\"Hello, \" + player1Name + \"!\");      System.out.println(\"Player 2, please, input your name\");     String player2Name = scanner.nextLine();     System.out.println(\"Hello, \" + player2Name + \"!\");          char[][] playerField1 = new char[FILED_LENGTH][FILED_LENGTH];     char[][] playerField2 = new char[FILED_LENGTH][FILED_LENGTH];      char[][] playerBattleField1 = new char[FILED_LENGTH][FILED_LENGTH];     char[][] playerBattleField2 = new char[FILED_LENGTH][FILED_LENGTH]; \t} }<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u043e\u0434\u0435:<\/p>\n<p>\u0412 \u0441\u0442\u0440\u043e\u043a\u0435 2 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 FIELD_LENGTH, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u043b\u044f &#8212; \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e 4 &#8212; \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c FIELD_LENGTH \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 10.<\/p>\n<p>\u0412 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 14-18 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b char. playerFiled1 \u0438 playerField2 &#8212; \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430. \u0420\u0430\u0437\u043c\u0435\u0440\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0440\u0430\u0432\u043d\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c \u043f\u043e\u043b\u044f &#8212; \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0432\u0435\u0434\u044c \u044d\u0442\u0438 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442 \u043f\u043e\u043b\u044f.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043b\u043e\u0433\u0438\u043a\u0435 \u043f\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u0435\u0439 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044f\u043c\u0438. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 fillPlayerField(playerField), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0443 \u0438\u0433\u0440\u043e\u043a\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c. <\/p>\n<pre><code class=\"java\">public class Main {     static final int FILED_LENGTH = 10;     static Scanner scanner = new Scanner(System.in);      public static void main(String[] args) {         System.out.println(\"Player 1, please, input your name\");         String player1Name = scanner.nextLine();         System.out.println(\"Hello, \" + player1Name + \"!\");          System.out.println(\"Player 2, please, input your name\");         String player2Name = scanner.nextLine();         System.out.println(\"Hello, \" + player2Name + \"!\");          char[][] playerField1 = new char[FILED_LENGTH][FILED_LENGTH];         char[][] playerField2 = new char[FILED_LENGTH][FILED_LENGTH];          fillPlayerField(playerField1);         fillPlayerField(playerField2);     } }  private static void fillPlayerField(char[][] playerField) { \t\/\/ your code will be here }<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 fillPlayerField \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c (static), \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430 main, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c. fillPlayerField \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (void). \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043a\u043e\u0440\u0430\u0431\u043b\u044f \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 playerField \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f. <\/p>\n<p>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439. \u0411\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u043a\u043e\u0440\u0430\u0431\u043b\u0438 \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e \u043f\u0430\u043b\u0443\u0431, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u043c \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u0447\u0435\u0442\u044b\u0440\u0451\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c, \u0437\u0430\u0442\u0435\u043c \u0432\u0441\u0435 \u0442\u0440\u0451\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u0438, \u0432\u0441\u0435 \u0434\u0432\u0443\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u0438 \u0438 \u0432\u0441\u0435 \u043e\u0434\u043d\u043e\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0435. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u0440\u0430\u0431\u043b\u044f \u0438 \u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0441\u043c. \u0431\u0438\u0437\u043d\u0435\u0441-\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u2116 6) &#8212; \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438\u043b\u0438 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u0432\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 fillPlayerField:<\/p>\n<pre><code>\u0420\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c 4-\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c: 1 Input x coord:  1 Input y coord:  1 1. Horizontal; 2. Vertical ? 1<\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043c\u0435\u0435\u043c:<\/p>\n<pre><code class=\"java\">private static void fillPlayerField(char[][] playerField) {     \/\/ your code will be here }<\/code><\/pre>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0440\u0430\u0431\u043b\u0438 \u0441 \u043f\u0430\u043b\u0443\u0431\u0430\u043c\u0438 \u043e\u0442 4 \u0434\u043e 1. \u0417\u0434\u0435\u0441\u044c \u0434\u0435\u043b\u043e \u0438\u0434\u0451\u0442 \u043a \u0446\u0438\u043a\u043b\u0443. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u043f\u0430\u0444\u043e\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c for. \u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u043f\u0430\u043b\u0443\u0431 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0435\u0449\u0451 \u043a\u0430\u043a-\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0433 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u0438\u0448\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u043b\u0443\u0431 (\u0441\u043c. \u0431\u0438\u0437\u043d\u0435\u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u21165) &#8212; \u044d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0442\u0430\u043a\u0436\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0446\u0438\u043a\u043b\u0430 &#8212; \u0431\u0435\u0437 \u043f\u0430\u0444\u043e\u0441\u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c for.<\/p>\n<pre><code class=\"java\">private static void fillPlayerField(char[][] playerField) { \t\t\/\/ i - \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u043b\u0443\u0431 \u0443 \u043a\u043e\u0440\u0430\u0431\u043b\u044f     \/\/ \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0441 \u043a\u043e\u0440\u0430\u0431\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e 4 \u043f\u0430\u043b\u0443\u0431\u044b, \u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u0440\u0430\u0431\u043b\u044f\u043c\u0438 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043b\u0443\u0431\u043e\u0439     for (int i = 4; i &gt;= 1; i--) {       \t\/\/ \u0441\u043c. \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u043e\u0434\u0435 \u043f\u043e\u0434 \u044d\u0442\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u043e\u0439     \t\tfor (int k = i; k &lt;= 5 - i; k++) {           \tSystem.out.println(\"\u0420\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \" + i + \"-\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c: \" + (q + 1));         \t\t\/\/ some your code here         }     } } <\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u043e\u0434\u0435:<\/p>\n<p>\u041d\u0430 5 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0446\u0438\u043a\u043b for (int k = 0; k &lt;= 5 &#8212; i; k++). \u041e\u0431\u044a\u044f\u0441\u043d\u044e, \u043e\u0442\u043a\u0443\u0434\u0430 \u0442\u0430\u043a\u0430\u044f \u043c\u0430\u0433\u0438\u044f. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 (\u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u043b\u0443\u0431) \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c. <\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0437\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0434\u0438\u043c \u0447\u0442\u043e-\u0442\u043e \u0432 \u0434\u0443\u0445\u0435:<\/p>\n<pre><code class=\"java\">int[][] shipTypeAmount = {{1, 4}, {2, 3}, {3, 2}, {4, 1}};<\/code><\/pre>\n<p>\u041c\u044b \u0431\u044b \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0446\u0438\u043a\u043b\u0435 (\u0441\u043c. \u0441\u0442\u0440\u043e\u043a\u0443 4) \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u043b\u0443\u0431, \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043a\u0430\u043b\u0438 \u0431\u044b \u0432 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u043a\u0430\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443. \u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u043f\u0438\u0441\u0430\u043b\u0438 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0431\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0442\u0430\u043a\u0430\u044f \u043a\u0440\u0430\u0441\u043e\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 &#8212; \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u043a\u0430\u043a \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u043e \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u043e\u0439, \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0437\u0430\u0445\u043e\u0447\u0435\u0442 &#171;\u043f\u0440\u0438\u0447\u0435\u0441\u0430\u0442\u044c&#187; \u0441\u0432\u043e\u0439 \u043a\u043e\u0434. <\/p>\n<p>\u042f \u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0441\u0443\u043c\u043c\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u043b\u0443\u0431 &#8212; \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, <img decoding=\"async\" class=\"formula inline\" source=\"1 + 2 = 5; 2 + 3 = 5;  3 + 2 = 5;  4 + 1 = 5\" alt=\"1 + 2 = 5; 2 + 3 = 5;  3 + 2 = 5;  4 + 1 = 5\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/570\/eca\/933\/570eca933e07d251ec07bbd86897bc3b.svg\">. \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0437\u043d\u0430\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u043b\u0443\u0431 \u0443 \u043a\u043e\u0440\u0430\u0431\u043b\u044f (\u0437\u043d\u0430\u044f \u0442\u0438\u043f \u043a\u043e\u0440\u0430\u0431\u043b\u044f), \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043e\u0434\u043d\u0438\u043c \u0438\u0433\u0440\u0430\u043a\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, <img decoding=\"async\" class=\"formula inline\" source=\"5 - 1 = 4\" alt=\"5 - 1 = 4\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4fa\/44a\/ccd\/4fa44accd891745b12547f76c1096fd0.svg\">&#8212; \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0433\u0440\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c 4 \u043e\u0434\u043d\u043e\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0445 \u043a\u043e\u0440\u0430\u0431\u043b\u044f. \u0412 \u0446\u0438\u043a\u043b\u0435 for \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0435 6 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0446\u0438\u043a\u043b\u0430 &#171;\u043b\u0430\u0439\u0442\u043e\u0432\u044b\u043c&#187; \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c &#8212; \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0435\u043b\u043e \u0437\u0430 \u043c\u0430\u043b\u044b\u043c &#8212; \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u0440\u0430\u0431\u043b\u044f \u0432 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<pre><code class=\"java\">private static void fillPlayerField(char[][] playerField) {         for (int i = 4; i &gt;= 1; i--) {             \/\/ \u0440\u0430\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0441\u0430\u043c\u0438\u0445 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439             for (int k = i; k &lt;= 5 - i; k++) {                 System.out.println(\"\u0420\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \" + i + \"-\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c: \" + (q + 1));                  System.out.println(\"Input x coord: \");                 x = scanner.nextInt();                  System.out.println(\"Input y coord: \");                 y = scanner.nextInt();                  System.out.println(\"1 - horizontal; 2 - vertical ?\");                 position = scanner.nextInt();                  \/\/ \u0435\u0441\u043b\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e               \tif (position == 1) {                     \/\/ \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c '1' \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0435\u0442\u043e\u043a \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043b\u0443\u0431 \u0443 \u043a\u043e\u0440\u0430\u0431\u043b\u044f                     for (int q = 0; q &lt; i; q++) {                         playerField[y][x + q] = '1';                     }                 }                              \t\/\/ \u0435\u0441\u043b\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e                 if (position == 2) {                   \t\/\/ \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0435\u0442\u043e\u043a \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043b\u0443\u0431 \u0443 \u043a\u043e\u0440\u0430\u0431\u043b\u044f                     for (int m = 0; m &lt; i; m++) {                         playerField[y + m][x] = '1';                     }                 }               \t\/\/ \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u043e\u043b\u0435 \u0438\u0433\u0440\u043e\u043a\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e, \u0433\u0434\u0435 \u0438\u0433\u0440\u043e\u043a \u0443\u0436\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043a\u043e\u0440\u0430\u0431\u043b\u0438               \t\/\/ \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 - \u0441\u043c. \u043d\u0438\u0436\u0435                 printField(playerField);             }         }     }<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u043e\u0434\u0435: <\/p>\n<p>\u041a\u043e\u0440\u0430\u0431\u043b\u044c \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u043c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c &#8216;1&#8217; \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043b\u0443\u0431 \u043e\u043d \u0438\u043c\u0435\u0435\u0442 &#8212; \u0435\u0441\u043b\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u0447\u0435\u0442\u044b\u0440\u0451\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439, \u0442\u043e \u043e\u043d \u0437\u0430\u0439\u043c\u0451\u0442 4 \u043a\u043b\u0435\u0442\u043a\u0438 &#8212; \u043f\u043e\u043c\u0435\u0447\u0430\u0435\u043c 4 \u043a\u043b\u0435\u0442\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c &#8216;1&#8217;.<\/p>\n<p>\u041d\u0430\u043c \u043d\u0435\u043e\u0434\u043d\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u0435\u0447\u0430\u0442\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u0438\u0433\u0440\u043e\u043a\u043e\u0432, \u043b\u0438\u0431\u043e \u043f\u043e\u043b\u044f \u0438\u0445 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u0432 \u043f\u043e \u0432\u0440\u0430\u0436\u0435\u0441\u043a\u043e\u043c\u0443 \u0444\u043b\u043e\u0442\u0443. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e &#8212; \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u043c\u0435\u0442\u043e\u0434 printField.<\/p>\n<pre><code class=\"java\">static void printField(char[][] field) {         for (char[] cells : monitor) {             for (char cell : t) {               \/\/ \u0435\u0441\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u0435\u0444\u043e\u043b\u0442\u043e\u0432\u043e\u0435 (\u0432 \u0441\u043b\u0443\u0447\u0430\u0435 char - 0), \u0437\u043d\u0430\u0447\u0438\u0442 \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u043a\u043b\u0435\u0442\u043a\u0435               \/\/ \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d - \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u043f\u0443\u0441\u0442\u0443\u044e \u043a\u043b\u0435\u0442\u043a\u0443                 if (cell == 0) {                     System.out.print(\" |\");                 } else {    \t\t\t\t\t\t\t\t\t\/\/ \u0435\u0441\u043b\u0438 \u043a\u043b\u0435\u0442\u043a\u0430 \u043d\u0435\u043f\u0443\u0441\u0442\u0430\u044f (\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u0435\u0442\u0441\u044f \u043e\u0442 \u0434\u0435\u0444\u043e\u043b\u0442\u043e\u0432\u043e\u0433\u043e),                   \t\/\/\u0442\u043e\u0433\u0434\u0430 \u043e\u0442\u0440\u0438\u0441\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0441\u043e\u0436\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043a\u043b\u0435\u0442\u043a\u0438 (\u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430)                     System.out.print(cell + \"|\");                 }             }             System.out.println(\"\");             System.out.println(\"--------------------\");         }     }<\/code><\/pre>\n<p>\u041d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043c\u0435\u0442\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439:<\/p>\n<pre><code> | | | | | | | | | | --------------------  |1|1|1|1| | | | | | --------------------  | | | | | | | | | | --------------------  | | | | | | | | | | --------------------  | | | | | | | | | | --------------------  | | | | | | | | | | --------------------  | | | | | | | | | | --------------------  | | | | | | | | | | --------------------  | | | | | | | | | | --------------------  | | | | | | | | | | --------------------<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u0438\u0433\u0440\u043e\u043a\u0438 \u0443\u0436\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u0441\u0432\u043e\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u0438 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435, \u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u0442\u044c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0443\u043d\u043a\u0442\u043e\u0432 8-10 \u0431\u0438\u0437\u043d\u0435\u0441-\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0439 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430.<\/p>\n<p>\u041b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430 \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0445\u043e\u0434\u0430 \u043e\u043f\u0438\u0448\u0435\u043c \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 playGame. \u0414\u0430\u0431\u044b \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f (\u0438\u043b\u0438 \u043f\u043e\u043a\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0440\u0430\u0442\u044c\u0441\u044f) \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0430 single responsobility &#8212; \u043d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u0434\u0435\u043b\u0438\u0442\u044c \u043b\u043e\u0433\u0438\u043a\u0443 \u043d\u0430 \u043c\u0435\u0442\u043e\u0434\u044b (1 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c &#8212; 1 \u043c\u0435\u0442\u043e\u0434, \u043d\u043e \u0442\u043e\u0436\u0435 \u0434\u0435\u0440\u0436\u0438\u043c \u0441\u0435\u0431\u044f \u0432 \u0440\u0443\u043a\u0430\u0445, \u043a\u043e\u0434, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c 100500 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0442\u043e\u0436\u0435 \u043d\u0435 \u043a\u043e\u043c\u0438\u043b\u044c\u0444\u043e) &#8212; \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u043e\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0435\u0449\u0435 \u043c\u0435\u0442\u043e\u0434\u044b handleShot \u0438 isPlayerAlive. \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043e\u0431\u043e\u0438\u0445 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u043d\u0438\u0436\u0435<\/p>\n<pre><code class=\"java\">\/** * \u041c\u0435\u0442\u043e\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0443 \u0438\u0433\u0440\u044b: \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0445\u043e\u0434\u0430. *\/ private static void playGame(String player1Name, String player2Name, char[][] playerField1, char[][] playerField2) {         \/\/ \"\u043a\u0430\u0440\u0442\u044b\" \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u0432 - \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0432\u0441\u0435 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u044b   \t\t\t\/\/ \u0443\u0434\u0430\u0447\u043d\u044b\u0435 (#) \u0438 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0435 (*)   \t\t\tchar[][] playerBattleField1 = new char[FILED_LENGTH][FILED_LENGTH];         char[][] playerBattleField2 = new char[FILED_LENGTH][FILED_LENGTH];    \t\t\t\/\/ \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 -    \t\t\t\/\/ \u0438\u0433\u0440\u043e\u043a\u0430, \u0447\u044c\u044f \u043e\u0447\u0435\u0440\u0435\u0434m \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0441\u0442\u0440\u0435\u043b. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0433\u0440\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u0438\u0433\u0440\u043e\u043a, \u043f\u0440\u043e\u0448\u0443 \u043f\u0440\u043e\u0448\u0435\u043d\u0438\u044f   \t\t\t\/\/ \u0437\u0430 \u0442\u0430\u0432\u0442\u043e\u043b\u043e\u0433\u0438\u044e         String currentPlayerName = player1Name;         char[][] currentPlayerField = playerField2;         char[][] currentPlayerBattleField = playerBattleField1;    \t\t\t\/\/ \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043c\u0435\u043d\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0441\u0442\u0438 \u0438\u0433\u0440\u043e\u043a\u043e\u0432, \u0432\u044b\u0441\u0442\u0440\u0435\u043b, \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430.   \t\t\t\/\/ \u043a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \"\u0436\u0438\u0432\u044b\" \u043e\u0431\u0430 \u0438\u0433\u0440\u043e\u043a\u0430 - \u043f\u043e\u043a\u0430 \u0443 \u0434\u0432\u0443\u0445 \u0438\u0433\u0440\u043e\u043a\u043e\u0432   \t\t\t\/\/ \"\u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\" \u0446\u0435\u043b (\u0440\u0430\u043d\u0435\u043d) \u0435\u0449\u0451 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u043a\u043e\u0440\u0430\u0431\u043b\u044c         while (isPlayerAlive(playerField1) &amp;&amp; isPlayerAlive(playerField2)) {           \t\/\/ \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430             System.out.println(currentPlayerName + \", please, input x coord of shot\");             int xShot = scanner.nextInt();             System.out.println(currentPlayerName + \", please, input y coord of shot\");             int yShot = scanner.nextInt();            \t\/\/ \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 handleShot             int shotResult = handleShot(currentPlayerBattleField, currentPlayerField, xShot, yShot);             \/\/ \u0435\u0441\u043b\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0439, \u0438 \u043d\u0435 \u043e\u0434\u0438\u043d \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u043d\u0435 \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0451\u043d, \u0442\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0438\u0433\u0440\u043e\u043a\u0443           \tif (shotResult == 0) {                 currentPlayerName = player2Name;               \tcurrentPlayerField = playerField1;               \tcurrentPlayerBattleField = playerBattleField2;             }         }     }  \t\t\/**     * \u041c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0432\u044b\u0441\u0442\u0440\u0435\u043b. \u0415\u0441\u043b\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u0443\u0434\u0430\u0447\u043d\u044b\u0439, \u0442\u043e \u0435\u0441\u0442\u044c \u0441\u043d\u0430\u0440\u044f\u0434 \u0434\u043e\u0441\u0442\u0438\u0433 \u0446\u0435\u043b\u0438 -     * \u0432 \u043a\u043b\u0435\u0442\u043a\u0443 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 '#' (\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043a \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0438\u0433\u0440\u043e\u043a\u0430, \u0442\u0430\u043a \u0438 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0441\u043e\u043f\u0435\u0440\u043d\u0438\u043a\u0430),     * \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 'Good shot!'. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 1.     * \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0433\u043e \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430 - \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 battleField \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 '0' \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 [y][x], \u0438     * \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 0.     * \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u044b \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0432 \u043c\u0435\u0442\u043e\u0434\u0435, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0442\u043e\u0434 handleShot,     * \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0443\u0441\u043f\u0435\u0448\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u0443\u0441\u043f\u0435\u0448\u043d\u043e \u043f\u0440\u043e\u0448\u0451\u043b \u0432\u044b\u0441\u0442\u0440\u0435\u043b. \u041d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u0435,  \t\t* \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0445\u043e\u0434 \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0438\u0433\u0440\u043e\u043a\u0443 \u0438\u043b\u0438 \u043d\u0435\u0442.     *\/     private static int handleShot(char[][] battleField, char[][] field, int x, int y) {         if ('1'.equals(field[y][x])) {             field[y][x] = '#';             battleField[y][x] = '#';             System.out.println(\"Good shot!\");             return 1;         }         battleField[y][x] = '*';         System.out.println(\"Bad shot!\");         return 0;     }  \t\t\/** \t\t*\t\u041c\u0435\u0442\u043e\u0434 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442, \u043d\u0435 \u043f\u0440\u043e\u0438\u0433\u0440\u0430\u043b \u043b\u0438 \u0435\u0449\u0435 \u0438\u0433\u0440\u043e\u043a. \u0415\u0441\u043b\u0438 \u0443 \u0438\u0433\u0440\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0445\u043e\u0442\u044f \u0431\u044b     * \u043e\u0434\u0438\u043d \"\u0440\u0430\u043d\u0435\u043d\u043d\u044b\u0439\" \u043a\u043e\u0440\u0430\u0431\u043b\u044c, \u0442\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0438\u0433\u0440\u0443.     * \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u043d\u0430 \u043a\u0430\u0440\u0442\u0435 \u0443 \u0438\u0433\u0440\u043e\u043a\u0430 \u043e\u0441\u0442\u0430\u043b\u0441\u044f \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u0441\u0438\u043c\u0432\u043e\u043b '1', \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u043c\u044b \u043e\u0442\u043c\u0435\u0447\u0430\u043b\u0438     * \u043a\u043e\u0440\u0430\u0431\u043b\u0438, \u0442\u043e \u0438\u0433\u0440\u0430 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442\u0441\u044f - \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 true. \u0418\u043d\u0430\u0447\u0435 false. \t\t*\/     private static boolean isPlayerAlive(char[][] field) {         for (char[] cells : field) {             for (char cell : cells) {                 if ('1' == cell) {                     return true;                 }             }         }         return false;     }<\/code><\/pre>\n<p>\u0414\u0443\u043c\u0430\u044e, \u0447\u0442\u043e \u043a \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u043c  \u0432 \u043a\u043e\u0434\u0435 \u043c\u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u0447\u0435\u0433\u043e. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u043e\u0431\u0440\u0430\u0449\u0443 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e\u043d\u043a\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442. \u041c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438 \u0432 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0435 \u043a \u0437\u0430\u043f\u0438\u0441\u0438 (x, y) &#8212; \u0433\u0434\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u0438\u0434\u0451\u0442 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0430\u0431\u0441\u0446\u0438\u0441\u0441, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 &#8212; \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 \u043e\u0440\u0434\u0438\u043d\u0430\u0442. \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 (\u0438\u043d\u043e\u0433\u0434\u0430 \u0441\u0440\u044b\u0432\u0430\u044e\u0441\u044c \u0438 \u043d\u0430\u0437\u044b\u0432\u0430\u044e \u0432 \u0442\u0435\u043a\u0441\u0442\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a\u043b\u0435\u0442\u043a\u043e\u0439, \u043d\u043e \u0441\u0443\u0442\u044c \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f) \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c <code>arr[x][y]<\/code>, \u043d\u043e \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0432\u0435\u0440\u043d\u043e, \u0438 \u0447\u0442\u043e\u0431\u044b \u044d\u0442\u043e \u0434\u043e\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043d\u0435\u043e\u043f\u0440\u0432\u0435\u0440\u0433\u0430\u0435\u043c\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u043f\u0440\u0438\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u0437\u0433\u043b\u044f\u0434\u0430. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432:<\/p>\n<pre><code class=\"java\">int[][] arr = {{1, 2}, {7, 4}, {8, 3, 5, 9}, {1}}  System.out.println(arr[0][1]); \/\/ ? System.out.println(arr[1][0]); \/\/ ? <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u043e\u043f\u0440\u043e\u0441 \u0438\u0437 \u043a\u0432\u0438\u0437\u0430 &#171;\u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438 \u043c\u0438\u0440&#187; &#8212; \u0447\u0442\u043e \u0432\u044b\u0432\u0435\u0434\u0435\u0442\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0432 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 3 \u0438 4?<br \/>\u0412\u0441\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u043c, \u0447\u0442\u043e \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 &#8212; \u044d\u0442\u043e \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u0430 (\u043d\u0430\u043c \u0442\u0430\u043a \u043f\u0440\u043e\u0449\u0435 \u0435\u0433\u043e \u0432\u043e\u0441\u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0438 \u0434\u0435\u0442\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0437\u0430\u0434\u0430\u0447\u0430\u0445) &#8212; \u044d\u0442\u043e &#171;\u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432&#187; &#8212; \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u0415\u0441\u043b\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u0446\u0435\u043b\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 &#8212; \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043c\u0430\u0441\u0441\u0438\u0432 (\u0430 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 &#8212; \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432). \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0435\u0440\u0432\u044b\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u043e\u0439 \u043f\u043e \u0441\u0447\u0451\u0442\u0443 \u043c\u0430\u0441\u0441\u0438\u0432 \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c. \u0412\u0442\u043e\u0440\u043e\u0439 \u0438\u043d\u0434\u0435\u043a\u0441 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043f\u043e \u0441\u0447\u0451\u0442\u0443 \u043c\u044b \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0432 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u043c \u0440\u0430\u043d\u0435\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0435. \u0417\u0430\u043f\u0438\u0441\u044c <code>arr[1][2]<\/code> \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043c\u044b \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c 2 (\u0442\u043e \u0435\u0441\u0442\u044c 3 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443) \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c 1 (\u0438\u043b\u0438 \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443). \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0432\u0435\u043d\u043d\u043e, \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 3 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0432\u044b\u0432\u0435\u0434\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 2, \u0430 \u0432 \u0441\u0442\u0440\u043e\u043a\u0435 4 &#8212; 7.<\/p>\n<p>\u041f\u043e\u0441\u0442\u0435\u043f\u0435\u043d\u043d\u043e \u043f\u043e\u0434\u0431\u0438\u0440\u0430\u0435\u043c\u0441\u044f \u043a \u043a\u043e\u043d\u0446\u0443. \u0427\u0442\u043e \u043d\u0430\u043c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c? <\/p>\n<ol>\n<li>\n<p>\u0412\u044b\u0432\u043e\u0434 \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044f <\/p>\n<\/li>\n<li>\n<p>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043a\u043b\u0435\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0443\u043a\u0430\u0437\u0430\u043b \u043a\u0430\u043a \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f<\/p>\n<\/li>\n<\/ol>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0449\u0435, \u0441\u0442\u0430\u0440\u0442\u0430\u043d\u0451\u043c \u0441 \u043d\u0435\u0433\u043e. \u041f\u043e\u0442\u043e\u043f\u0430\u043b\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434 playGame &#8212; \u043a\u0430\u043a \u0432\u044b \u043f\u043e\u043c\u043d\u0438\u0442\u0435, \u0442\u0430\u043c \u0435\u0441\u0442\u044c \u0446\u0438\u043a\u043b while, \u0432 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0435\u0441\u0442\u044c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 &#8212; \u0436\u0438\u0432\u044b \u043b\u0438 \u0435\u0449\u0435 \u043e\u0431\u0430 \u0438\u0433\u0440\u043e\u043a\u0430. \u041d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u0438\u0433\u0440\u043e\u043a &#171;\u043c\u0451\u0440\u0442\u0432&#187;, \u0442\u043e \u0435\u0441\u0442\u044c \u0443 \u043d\u0435\u0433\u043e \u043d\u0435 \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u043d\u0438 \u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f, \u0442\u043e \u0438\u0433\u0440\u0430 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f, \u0430 \u0432\u044b\u0436\u0438\u0432\u0448\u0438\u0439 \u0438\u0433\u0440\u043e\u043a \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u0435\u043c. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u043e\u0441\u044c &#8212; \u0441\u0442\u0440\u043e\u0447\u043a\u0430 36 &#8212; \u0432\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u0430 System.out.println()<\/p>\n<pre><code class=\"java\">\/** * \u041c\u0435\u0442\u043e\u0434 \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u0442 \u043b\u043e\u0433\u0438\u043a\u0443 \u0438\u0433\u0440\u044b: \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0445\u043e\u0434\u0430. *\/ private static void playGame(String player1Name, String player2Name, char[][] playerField1, char[][] playerField2) { \t\t\/\/ \"\u043a\u0430\u0440\u0442\u044b\" \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u0432 - \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0432\u0441\u0435 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u044b     \/\/ \u0443\u0434\u0430\u0447\u043d\u044b\u0435 (#) \u0438 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0435 (*)     char[][] playerBattleField1 = new char[FILED_LENGTH][FILED_LENGTH];     char[][] playerBattleField2 = new char[FILED_LENGTH][FILED_LENGTH];      \/\/ \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0431\u0443\u0434\u0443\u0442 \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 -      \/\/ \u0438\u0433\u0440\u043e\u043a\u0430, \u0447\u044c\u044f \u043e\u0447\u0435\u0440\u0435\u0434m \u0434\u0435\u043b\u0430\u0442\u044c \u0432\u044b\u0441\u0442\u0440\u0435\u043b. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0438\u0433\u0440\u0430\u0435\u0442 \u043f\u0435\u0440\u0432\u044b\u0439 \u0438\u0433\u0440\u043e\u043a, \u043f\u0440\u043e\u0448\u0443 \u043f\u0440\u043e\u0448\u0435\u043d\u0438\u044f     \/\/ \u0437\u0430 \u0442\u0430\u0432\u0442\u043e\u043b\u043e\u0433\u0438\u044e     String currentPlayerName = player1Name;     char[][] currentPlayerField = playerField2;     char[][] currentPlayerBattleField = playerBattleField1;      \/\/ \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043c\u0435\u043d\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0441\u0442\u0438 \u0438\u0433\u0440\u043e\u043a\u043e\u0432, \u0432\u044b\u0441\u0442\u0440\u0435\u043b, \u0435\u0433\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430.     \/\/ \u043a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 \u0446\u0438\u043a\u043b\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0434\u043e \u0442\u0435\u0445 \u043f\u043e\u0440, \u043f\u043e\u043a\u0430 \"\u0436\u0438\u0432\u044b\" \u043e\u0431\u0430 \u0438\u0433\u0440\u043e\u043a\u0430 - \u043f\u043e\u043a\u0430 \u0443 \u0434\u0432\u0443\u0445 \u0438\u0433\u0440\u043e\u043a\u043e\u0432     \/\/ \"\u0447\u0430\u0441\u0442\u0438\u0447\u043d\u043e\" \u0446\u0435\u043b (\u0440\u0430\u043d\u0435\u043d) \u0435\u0449\u0451 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u043a\u043e\u0440\u0430\u0431\u043b\u044c     while (isPlayerAlive(playerField1) &amp;amp;&amp;amp; isPlayerAlive(playerField2)) {       \t\/\/ \u043f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u044b\u043c \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u043e\u0432 \u0438\u0433\u0440\u043e\u043a\u0430       \tprintField(currentPlayerBattleField);         \/\/ \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u0432\u044b\u0441\u0442\u0440\u0435\u043b\u0430         System.out.println(currentPlayerName + \", please, input x coord of shot\");         int xShot = scanner.nextInt();         System.out.println(currentPlayerName + \", please, input y coord of shot\");         int yShot = scanner.nextInt();          \/\/ \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u043c \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430 handleShot         int shotResult = handleShot(currentPlayerBattleField, currentPlayerField, xShot, yShot);         \/\/ \u0435\u0441\u043b\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0439, \u0438 \u043d\u0435 \u043e\u0434\u0438\u043d \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u043d\u0435 \u043f\u043e\u0432\u0440\u0435\u0436\u0434\u0451\u043d, \u0442\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0438\u0433\u0440\u043e\u043a\u0443           if (shotResult == 0) {             currentPlayerName = player2Name;               currentPlayerField = playerField1;               currentPlayerBattleField = playerBattleField2;         }     }   \tSystem.out.println(currentPlayerName + \" is winner!\"); }<\/code><\/pre>\n<p>\u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a\u043e \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0443\u043d\u043a\u0442\u0443 \u043d\u0430\u0448\u0438\u0445 &#171;\u043e\u0441\u0442\u0430\u0442\u043a\u043e\u0432&#187; &#8212; \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043a\u043b\u0435\u0442\u043a\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u043a\u0430\u0437\u0430\u043b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c &#8212; \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f.<\/p>\n<p>\u0417\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u043d\u0435 \u0443\u0442\u043e\u0447\u043d\u0438\u043b, \u043d\u043e \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0430 \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 \u0438\u0433\u0440\u044b \u0432 \u044d\u0442\u043e\u043c \u043f\u043b\u0430\u043d\u0435 \u043d\u0435 \u043e\u0442\u043b\u0438\u0447\u0430\u044e\u0442\u0441\u044f \u043e\u0442 \u0431\u0443\u043c\u0430\u0436\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 &#8212; \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u0440\u0430\u0431\u043b\u044f\u043c\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u043e\u0434\u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0430 &#8212; \u044d\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u0432 \u043e\u043a\u0440\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0441 \u0440\u0430\u0434\u0438\u0443\u0441\u043e\u043c \u043e\u0434\u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0430 \u043e\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0433\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f \u043d\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0445 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439. \u0414\u043b\u044f \u043d\u0430\u0433\u043b\u044f\u0434\u043d\u043e\u0441\u0442\u0438 &#8212; \u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043e\u043a. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/e03\/1e4\/00c\/e031e400c290f4cca19c46ce68ed780e.jpg\" alt=\"\u041e\u043a\u0440\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0441 \u0440\u0430\u0434\u0438\u0443\u0441\u043e\u043c \u043e\u0434\u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0430.  \u041a\u0440\u0430\u0441\u043d\u044b\u043c \u043a\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u043a\u043b\u0435\u0442\u043a\u0430 - \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f.\" title=\"\u041e\u043a\u0440\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0441 \u0440\u0430\u0434\u0438\u0443\u0441\u043e\u043c \u043e\u0434\u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0430.  \u041a\u0440\u0430\u0441\u043d\u044b\u043c \u043a\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u043a\u043b\u0435\u0442\u043a\u0430 - \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f.\" width=\"253\" height=\"252\"><figcaption>\u041e\u043a\u0440\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u044c \u0441 \u0440\u0430\u0434\u0438\u0443\u0441\u043e\u043c \u043e\u0434\u043d\u0430 \u043a\u043b\u0435\u0442\u043a\u0430.  \u041a\u0440\u0430\u0441\u043d\u044b\u043c \u043a\u0440\u0443\u0433\u043e\u043c \u043f\u043e\u043c\u0435\u0447\u0435\u043d\u0430 \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u044f \u043a\u043b\u0435\u0442\u043a\u0430 &#8212; \u043d\u0430\u0447\u0430\u043b\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f.<\/figcaption><\/figure>\n<p>\u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 &#8212; \u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u043a\u043b\u0435\u0442\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0440\u0430\u0431\u043b\u044c, \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c, \u0435\u0441\u0442\u044c \u043b\u0438 \u0432 \u043e\u043a\u0440\u0435\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0441 \u0440\u0430\u0434\u0438\u0443\u0441\u043e\u043c \u043e\u0434\u0438\u043d \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u043b\u0435\u0442\u043a\u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u0438. \u0415\u0441\u043b\u0438 \u0445\u043e\u0442\u044f \u0431\u044b \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u043a\u043b\u0435\u0442\u043a\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043b\u043e\u0441\u044c, \u0442\u043e \u0435\u0441\u0442\u044c \u0435\u0441\u0442\u044c \u043d\u0430 \u043f\u043e\u043b\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f &#171;\u0441\u043b\u0438\u0448\u043a\u043e\u043c&#187; \u0440\u044f\u0434\u043e\u043c \u0441 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u044b\u043c &#8212; \u0441\u043e\u043e\u0431\u0449\u0430\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0435 \u0438 \u043f\u0440\u043e\u0441\u0438\u043c \u0435\u0433\u043e \u0432\u0432\u0435\u0441\u0442\u0438 \u043d\u043e\u0432\u044b\u0435 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b.<\/p>\n<p>\u041a\u0430\u043a\u0438\u0435 \u043d\u044e\u0430\u043d\u0441\u044b \u0435\u0441\u0442\u044c \u0432 \u044d\u0442\u043e\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435? \u0421\u043d\u043e\u0432\u0430 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043e\u043a.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/eb7\/ead\/54b\/eb7ead54b3e40df1c6cd5c24cf73aba3.jpg\" alt=\"\u041d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430.  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043b\u0435\u0442\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437.\" title=\"\u041d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430.  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043b\u0435\u0442\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437.\" width=\"1139\" height=\"550\"><figcaption>\u041d\u0435\u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430.  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043a\u043b\u0435\u0442\u043a\u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437.<\/figcaption><\/figure>\n<pre><code class=\"java\">private static int validateCoordForShip(char[][] field, int x, int y, int position, int shipType) {         \/\/ \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0445\u043e\u0447\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e   \t\t\tif (position == 1) {             for (int i = 0; i &lt; shipType - 1; i++) { \t\t\t\t\t\t\t\tif ('1' == field[y][x + i]                                 || '1' == field[y - 1][x + i]                                 || '1' == field[y + 1][x + i]                                 || '1' == field[y][x + i + 1]                                 || '1' == field[y][x + i - 1] \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t|| (x + i) &gt; 9) {                     return -1;                 }             }         } else if (position == 2) {           \t\/\/ \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0445\u043e\u0447\u0435\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e             for (int i = 0; i &lt; shipType - 1; i++) {                 if ('1' == field[y][x + i]                         || '1' == field[y - 1][x + i]                         || '1' == field[y + 1][x + i]                         || '1' == field[y][x + i + 1]                         || '1' == field[y][x + i - 1] \t\t\t\t\t\t\t\t\t\t\t\t|| (y + i) &gt; 9) {                     return -1;                 }             }         }         return 0;     }<\/code><\/pre>\n<p>\u041d\u0435 \u0437\u0430\u0431\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u043e\u0430\u043f\u0433\u0440\u0435\u0439\u0434\u0438\u0442\u044c \u043c\u0435\u0442\u043e\u0434 fillPlayerField &#8212; \u043d\u0430\u043f\u043e\u043c\u043d\u044e, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0438\u0433\u0440\u043e\u043a\u0430\u043c\u0438.<\/p>\n<pre><code class=\"java\">private static void fillPlayerField(char[][] playerField) {         for (int i = 4; i &gt;= 1; i--) {             \/\/ \u0440\u0430\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439             for (int k = i; k &lt;= 5 - i; k++) {                 System.out.println(\"\u0420\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \" + i + \"-\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c: \" + (q + 1)); \t\t\t\t\t\t\t\t               \t\/\/ \u0438\u043d\u0438\u0446\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043d\u0430\u0447\u0430\u043b\u044c\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c               \tint validationResult = 1;             \t\twhile (validationResult != 0) {               \t\t\tSystem.out.println(\"Input x coord: \");             \t\t\t\tx = scanner.nextInt();              \t\t\t\tSystem.out.println(\"Input y coord: \");            \t\t \t\t\ty = scanner.nextInt();              \t\t\t\tSystem.out.println(\"1 - horizontal; 2 - vertical ?\");             \t\t\t\tposition = scanner.nextInt();                   \t\/\/ \u0435\u0441\u043b\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u0430 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e (\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443), \u0442\u043e \u043c\u0435\u0442\u043e\u0434 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \t\t\t\t\t\t\t\t\t\t\/\/ \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043e\u043d\u043e \u043d\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u043b\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0432\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b                   \t\/\/ \u0435\u0449\u0451 \u0440\u0430\u0437                   \tvalidationResult = validateCoordForShip(playerField, x, y, position, i);                 }              \t\t\/\/ \u0435\u0441\u043b\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u043e               \tif (position == 1) {                 \t\t\/\/ \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c '1' \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0435\u0442\u043e\u043a \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043b\u0443\u0431 \u0443 \u043a\u043e\u0440\u0430\u0431\u043b\u044f                 \t\tfor (int q = 0; q &lt; i; q++) {                     \t\tplayerField[y][x + q] = '1';                 \t\t}             \t\t}                          \t\/\/ \u0435\u0441\u043b\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u043e             \t\tif (position == 2) {                   \t\/\/ \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043b\u0435\u0442\u043e\u043a \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u043b\u0443\u0431 \u0443 \u043a\u043e\u0440\u0430\u0431\u043b\u044f                 \t\tfor (int m = 0; m &lt; i; m++) {                     \t\tplayerField[y + m][x] = '1';                 \t\t}             \t\t}               \t\/\/ \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u043c \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u043e\u043b\u0435 \u0438\u0433\u0440\u043e\u043a\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u043e, \u0433\u0434\u0435 \u0438\u0433\u0440\u043e\u043a \u0443\u0436\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u043b \u043a\u043e\u0440\u0430\u0431\u043b\u0438               \t\/\/ \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 - \u0441\u043c. \u043d\u0438\u0436\u0435             \t\tprintField(playerField);         \t\t}     \t\t} }<\/code><\/pre>\n<p>\u0412\u043e\u0442 \u043c\u044b \u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0438\u0433\u0440\u0443 &#171;\u041c\u043e\u0440\u0441\u043a\u043e\u0439 \u0431\u043e\u0439&#187; &#8212; level 1. \u041d\u0430\u0447\u0430\u043b\u0438 \u0441 \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e &#8212; \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439, \u0438\u0434\u0435\u0439 \u0438 \u043c\u0435\u0442\u043e\u0434\u043e\u0432. \u041e\u0434\u0438\u043d \u043a\u043b\u0430\u0441\u0441, \u043d\u0435\u0442 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0439 &#8212; \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u044b. \u041e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0446\u0438\u043a\u043b\u0430\u0445 \u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u0445 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0438\u0433\u0440\u0443.<\/p>\n<p>\u041c\u044b \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u043b\u0438 \u0432\u0441\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u0437\u043d\u0435\u0441\u0430. \u0414\u043e\u0438\u0433\u0440\u044b\u0432\u0430\u044f \u0434\u043e \u043a\u043e\u043d\u0446\u0430, \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u0443\u044e \u043e\u0446\u0435\u043d\u043a\u0443 \u043e\u0442 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a\u0430, \u043e\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0434\u043e\u0432\u043e\u043b\u0435\u043d \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c. \u0416\u0434\u0451\u043c, \u043a\u043e\u0433\u0434\u0430 \u043e\u043d \u043e\u043f\u0440\u043e\u0431\u0443\u0435\u0442 \u0438\u0433\u0440\u0443 \u0438 \u0432\u0435\u0440\u043d\u0451\u0442\u0441\u044f \u0441\u043d\u043e\u0432\u0430 \u0437\u0430 \u0430\u043f\u0433\u0440\u0435\u0439\u0434\u043e\u043c. \u0410 \u0442\u0443\u0442 \u0438 \u0431\u0443\u0434\u0435\u0442 level &#8212; 2. <\/p>\n<p>\u0412\u0441\u0435\u043c \u0441\u043f\u0430\u0441\u0438\u0431\u043e, \u0432\u0441\u0435\u0433\u0434\u0430 \u0440\u0430\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0439 \u0441\u0432\u044f\u0437\u0438!<\/p>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/563210\/\"> https:\/\/habr.com\/ru\/post\/563210\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<p>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442!<\/p>\n<p>\u0421\u0442\u0430\u0442\u044c\u044f \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u0442\u0435\u043c, \u043a\u0442\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0432\u0440\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0443\u0432\u043b\u0435\u043a\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0438\u0440 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0430 Java \u0438 \u0438\u0449\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0438\u043c \u0437\u043d\u0430\u043d\u0438\u044f\u043c. \u041a\u043b\u0430\u0441\u0441\u043d\u043e, \u0447\u0442\u043e \u0432\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0437\u043d\u0430\u0435\u0442\u0435, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435, \u043c\u0435\u0442\u043e\u0434\u044b \u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043d\u043e, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u0438\u0441\u0430\u0442\u044c &#171;\u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435&#187; \u0434\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b, \u0430 \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0435 \u043c\u0435\u043b\u043a\u0438\u0435 \u0443\u043f\u0440\u0430\u0436\u043d\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u0434\u0430\u0447\u0438, \u0445\u043e\u0442\u044f \u0431\u0435\u0437 \u044d\u0442\u043e\u0433\u043e \u0442\u043e\u0436\u0435 \u043d\u0438\u043a\u0443\u0434\u0430. \u0412 \u043e\u0431\u0449\u0435\u043c, \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0442\u0435\u043e\u0440\u0438\u044e \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439. \u041f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u043e\u0431\u0441\u0443\u0434\u0438\u043c, \u043a\u0430\u043a\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f &#171;\u0431\u0438\u0437\u043d\u0435\u0441&#187; \u043f\u0440\u0435\u0434\u044a\u044f\u0432\u0438\u043b \u043a \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e. \u041f\u043e\u0441\u043b\u0435 \u0434\u043e\u043b\u0433\u0438\u0445 \u043f\u0435\u0440\u0435\u0433\u043e\u0432\u043e\u0440\u043e\u0432 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u0443\u0442\u0432\u0435\u0440\u0434\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0438\u0433\u0440\u044b:<\/p>\n<ol>\n<li>\n<p>\u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u041d\u0430\u0448 \u0437\u0430\u043a\u0430\u0437\u0447\u0438\u043a \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0440\u0435\u0442\u0440\u043e\u0433\u0440\u0430\u0434\u043e\u043c, \u0438 \u043e\u043d \u0441\u0447\u0438\u0442\u0430\u0435\u0442, \u0447\u0442\u043e \u0435\u0433\u043e \u0446\u0435\u043b\u0435\u0432\u043e\u0439 \u0430\u0443\u0434\u0438\u0442\u043e\u0440\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. \u0423 \u0432\u0441\u0435\u0445 \u0441\u0432\u043e\u0438 \u043f\u0440\u0438\u0447\u0443\u0434\u044b, \u043d\u043e \u043b\u0430\u0434\u043d\u043e.<\/p>\n<\/li>\n<li>\n<p>\u041e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0432 \u0438\u0433\u0440\u0435 \u043c\u043e\u0433\u0443\u0442 \u0443\u0447\u0430\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0430 \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430.<\/p>\n<\/li>\n<li>\n<p>\u0412 \u0441\u0430\u043c\u043e\u043c \u043d\u0430\u0447\u0430\u043b\u0435 \u0438\u0433\u0440\u043e\u043a\u0438 &#171;\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442\u0441\u044f&#187; &#8212; \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 &#171;\u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442&#187; (\u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0432\u0432\u0435\u0441\u0442\u0438), \u043a\u0430\u043a\u0438\u0435 \u0443 \u043d\u0438\u0445 \u0438\u043c\u0435\u043d\u0430<\/p>\n<\/li>\n<li>\n<p>\u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 \u0435\u0441\u0442\u044c \u0441\u0432\u043e\u0451 \u043f\u043e\u043b\u0435 &#8212; \u043a\u0432\u0430\u0434\u0440\u0430\u0442 10\u044510 \u043a\u043b\u0435\u0442\u043e\u043a<\/p>\n<\/li>\n<li>\n<p>\u0417\u0430\u0442\u0435\u043c \u0438\u0433\u0440\u043e\u043a\u0438 \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u0432\u043e\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u0438. \u041a\u0430\u043a \u0438 \u0432 &#171;\u0431\u0443\u043c\u0430\u0436\u043d\u043e\u0439&#187; \u0432\u0435\u0440\u0441\u0438\u0438 &#8212; \u043a\u0430\u0436\u0434\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c 4 \u043e\u0434\u043d\u043e\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0445 \u043a\u043e\u0440\u0430\u0431\u043b\u044f, 3 \u0434\u0432\u0443\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0445, 2 \u0442\u0440\u0435\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0445 \u0438 1 \u0447\u0435\u0442\u044b\u0440\u0451\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439. <\/p>\n<\/li>\n<li>\n<p>\u041a\u043e\u0440\u0430\u0431\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438\u043b\u0438 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0418\u0433\u0440\u043e\u043a\u0438 \u043d\u0435 \u0432\u0438\u0434\u044f\u0442 \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0438\u0433\u0440\u0430. \u041f\u0435\u0440\u0432\u044b\u0439 \u0438\u0433\u0440\u043e\u043a \u0434\u0435\u043b\u0430\u0435\u0442 \u0432\u044b\u0441\u0442\u0440\u0435\u043b, \u0441\u043e\u043e\u0431\u0449\u0430\u044f \u043d\u0430\u0448\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0439 \u0446\u0435\u043b\u0438 &#8212; \u043d\u043e\u043c\u0435\u0440 \u043a\u043b\u0435\u0442\u043a\u0438 \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438 \u043d\u043e\u043c\u0435\u0440 \u043a\u043b\u0435\u0442\u043a\u0438 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0441\u043b\u0438 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0441\u044f \u0443\u0434\u0430\u0447\u043d\u044b\u043c, \u0438 \u043e\u043d \u043f\u043e\u0440\u0430\u0437\u0438\u043b \u0446\u0435\u043b\u044c, \u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0434\u0432\u0430 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430 \u0440\u0430\u0437\u0432\u0438\u0442\u0438\u044f \u0441\u043e\u0431\u044b\u0442\u0438\u0439. <\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0439 \u0438\u0433\u0440\u043e\u043a\u043e\u043c \u043a\u043b\u0435\u0442\u043a\u0438 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043a\u043e\u0440\u0430\u0431\u043b\u044c, \u0442\u043e, \u0435\u0441\u043b\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u043e\u0434\u043d\u043e\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439, \u0438\u0433\u0440\u043e\u043a &#171;\u0443\u0431\u0438\u043b&#187; \u043a\u043e\u0440\u0430\u0431\u043b\u044c, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043e\u0434\u043d\u043e\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439, \u0442\u043e \u0440\u0430\u043d\u0438\u043b. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0445\u043e\u0434 \u0441\u043d\u043e\u0432\u0430 \u0437\u0430 \u043f\u0435\u0440\u0432\u044b\u043c \u0438\u0433\u0440\u043e\u043a\u043e\u043c.<\/p>\n<p>\u0412\u0442\u043e\u0440\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0435\u0441\u043b\u0438 \u0438\u0433\u0440\u043e\u043a \u043d\u0435 \u043f\u043e\u043f\u0430\u043b \u043d\u0438 \u0432 \u043a\u0430\u043a\u043e\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c, \u0442\u043e \u0445\u043e\u0434 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u0442 \u0432\u0442\u043e\u0440\u043e\u043c\u0443 \u0438\u0433\u0440\u043e\u043a\u0443.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043f\u0443\u043d\u043a\u0442\u0435 8, \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u044f \u0445\u043e\u0434 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0443, \u0438\u0433\u0440\u043e\u043a\u0438 \u043f\u044b\u0442\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435 \u0443\u043d\u0438\u0447\u0442\u043e\u0436\u0438\u0442\u044c \u043a\u043e\u0440\u0430\u0431\u043b\u0438 \u0434\u0440\u0443\u0433 \u0434\u0440\u0443\u0433\u0430. \u0422\u043e\u0442, \u043a\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u043c, \u043e\u0434\u043e\u043b\u0435\u0435\u0442 \u0444\u043b\u043e\u0442\u0438\u043b\u0438\u044e \u0432\u0440\u0430\u0433\u0430 &#8212; \u043f\u043e\u0431\u0435\u0434\u0438\u0442\u0435\u043b\u044c. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043f\u0435\u0447\u0430\u0442\u0430\u0435\u0442 \u043f\u043e\u0437\u0434\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c, \u0441\u043e\u0433\u043b\u0430\u0441\u043e\u0432\u0430\u0432 \u0441 \u0431\u0438\u0437\u043d\u0435\u0441\u043e\u043c \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0442\u044c \u043a \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0438\u0433\u0440\u044b.<\/p>\n<\/li>\n<\/ol>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u043b\u044e\u0431\u043e\u043c Java \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0430\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043a\u043b\u0430\u0441\u0441 (\u043d\u0435 \u0443\u043c\u0430\u043b\u044f\u044f \u043e\u0431\u0449\u043d\u043e\u0441\u0442\u0438 \u043d\u0430\u0437\u043e\u0432\u0451\u043c \u0435\u0433\u043e Main), \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d, \u044f \u0434\u0443\u043c\u0430\u044e \u0443\u0436\u0435 \u0432\u0441\u0435\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0439, \u043c\u0435\u0442\u043e\u0434 main.<\/p>\n<pre><code class=\"java\">public class Main { \tpublic static void main(String[] args) {   \t\/\/your code will be here \t} }<\/code><\/pre>\n<p>\u041f\u043e\u043a\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u043e\u0432\u043e\u0433\u043e, \u043d\u0430 \u044d\u0442\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u0440\u043e\u0431\u043e\u0432\u0430\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0430\u0448\u0435 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0438 &#171;\u0441\u0430\u043c\u0430\u044f \u043f\u0440\u043e\u0441\u0442\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u043d\u0430 \u0441\u0432\u0435\u0442\u0435&#187; \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u0437 \u043e\u0448\u0438\u0431\u043e\u043a.<\/p>\n<p>\u041e\u043f\u0438\u0440\u0430\u044f\u0441\u044c \u043d\u0430 \u043f\u0443\u043d\u043a\u0442\u044b 1-3 \u0443\u0442\u0432\u0435\u0440\u0436\u0434\u0435\u043d\u043d\u043e\u0433\u043e \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u044f, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c \u0438\u0433\u0440\u043e\u043a\u0430\u043c \u0432\u0432\u0435\u0441\u0442\u0438 \u0441\u0432\u043e\u0438 \u0438\u043c\u0435\u043d\u0430. \u0417\u0434\u0435\u0441\u044c \u043d\u0430\u043c \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441 java.util.Scanner, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0443\u043c\u0435\u0435\u0442 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438. <\/p>\n<pre><code class=\"java\">public class Main {     static Scanner scanner = new Scanner(System.in);      public static void main(String[] args) {         System.out.println(\"Player 1, please, input your name\");         String player1Name = scanner.nextLine();         System.out.println(\"Hello, \" + player1Name + \"!\");          System.out.println(\"Player 2, please, input your name\");         String player2Name = scanner.nextLine();         System.out.println(\"Hello, \" + player2Name + \"!\");     } }<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u043e\u0434\u0435:<\/p>\n<p>\u0412 \u0441\u0442\u0440\u043e\u043a\u0435 2 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u043d\u043e\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043a\u043b\u0430\u0441\u0441\u0430 Main scanner.<\/p>\n<p>\u041d\u0435\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 nextLine() \u043a\u043b\u0430\u0441\u0441\u0430 Scanner (\u0441\u0442\u0440\u043e\u043a\u0438 6 \u0438 11) \u043e\u0431\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u043a \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0441\u0442\u0440\u043e\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043e\u043d \u0435\u0449\u0435 \u043d\u0435 \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043b.    <\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043c\u0435\u043d\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043f\u0440\u0438\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c &#8212; &#171;Hello, {username} !&#187;<\/p>\n<p>\u0412 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0431\u0443\u0434\u0435\u043c \u0432\u0438\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435, \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u043a\u043e\u0434 \u0441\u0435\u0439\u0447\u0430\u0441.<\/p>\n<pre><code>Player 1, please, input your name Egor Hello, Egor! Player 2, please, input your name Max Hello, Max!<\/code><\/pre>\n<p>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043f\u043e\u043b\u0435 \u0431\u043e\u044f \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f\u043c\u0438. \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u0447\u0442\u043e \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 char[][] buttlefield. \u0412 \u043d\u0435\u043c \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439. \u0414\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0443\u0434\u0430\u0447\u043d\u043e\u0435 \u043f\u043e\u043f\u0430\u0434\u0430\u043d\u0438\u0435 \u0432 \u043a\u043e\u0440\u0430\u0431\u043b\u044c \u043f\u0440\u043e\u0442\u0438\u0432\u043d\u0438\u043a\u0430 \u0431\u0443\u0434\u0435\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c #. \u041d\u0435\u0443\u0434\u0430\u0447\u043d\u044b\u0439 \u0432\u044b\u0441\u0442\u0440\u0435\u043b \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043c\u0435\u0447\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u043c *. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e, \u043c\u0430\u0441\u0441\u0438\u0432 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u0434\u0435\u0444\u043e\u043b\u0442\u043e\u0432\u044b\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u0430 char \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c (&#8216;\\u0000&#8217;), \u0430 \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u0433\u0440\u044b \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c\u0441\u044f \u0441\u0438\u043c\u0432\u043e\u043b\u0430\u043c\u0438 # \u0438 *.<\/p>\n<pre><code class=\"java\">public class Main { \t\tstatic final int FILED_LENGTH = 10;     static Scanner scanner = new Scanner(System.in);  public static void main(String[] args) {     System.out.println(\"Player 1, please, input your name\");     String player1Name = scanner.nextLine();     System.out.println(\"Hello, \" + player1Name + \"!\");      System.out.println(\"Player 2, please, input your name\");     String player2Name = scanner.nextLine();     System.out.println(\"Hello, \" + player2Name + \"!\");          char[][] playerField1 = new char[FILED_LENGTH][FILED_LENGTH];     char[][] playerField2 = new char[FILED_LENGTH][FILED_LENGTH];      char[][] playerBattleField1 = new char[FILED_LENGTH][FILED_LENGTH];     char[][] playerBattleField2 = new char[FILED_LENGTH][FILED_LENGTH]; \t} }<\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u043e\u0434\u0435:<\/p>\n<p>\u0412 \u0441\u0442\u0440\u043e\u043a\u0435 2 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 FIELD_LENGTH, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u043b\u044f &#8212; \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044e 4 &#8212; \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u0443\u0435\u043c FIELD_LENGTH \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c 10.<\/p>\n<p>\u0412 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 14-18 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b char. playerFiled1 \u0438 playerField2 &#8212; \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0433\u0440\u043e\u043a\u0430. \u0420\u0430\u0437\u043c\u0435\u0440\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0440\u0430\u0432\u043d\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u0430\u043c \u043f\u043e\u043b\u044f &#8212; \u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0432\u0435\u0434\u044c \u044d\u0442\u0438 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u044b \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442 \u043f\u043e\u043b\u044f.<\/p>\n<p>\u041f\u0435\u0440\u0435\u0439\u0434\u0451\u043c \u043a \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044e \u043b\u043e\u0433\u0438\u043a\u0435 \u043f\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u043f\u043e\u043b\u0435\u0439 \u0438\u0433\u0440\u043e\u043a\u043e\u0432 \u0441\u0432\u043e\u0438\u043c\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044f\u043c\u0438. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 fillPlayerField(playerField), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0442\u044c \u0443 \u0438\u0433\u0440\u043e\u043a\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u043e\u0440\u0430\u0431\u043b\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u043e\u0432\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c. <\/p>\n<pre><code class=\"java\">public class Main {     static final int FILED_LENGTH = 10;     static Scanner scanner = new Scanner(System.in);      public static void main(String[] args) {         System.out.println(\"Player 1, please, input your name\");         String player1Name = scanner.nextLine();         System.out.println(\"Hello, \" + player1Name + \"!\");          System.out.println(\"Player 2, please, input your name\");         String player2Name = scanner.nextLine();         System.out.println(\"Hello, \" + player2Name + \"!\");          char[][] playerField1 = new char[FILED_LENGTH][FILED_LENGTH];         char[][] playerField2 = new char[FILED_LENGTH][FILED_LENGTH];          fillPlayerField(playerField1);         fillPlayerField(playerField2);     } }  private static void fillPlayerField(char[][] playerField) { \t\/\/ your code will be here }<\/code><\/pre>\n<p>\u041c\u0435\u0442\u043e\u0434 fillPlayerField \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c (static), \u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u0438\u0437 \u043c\u0435\u0442\u043e\u0434\u0430 main, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c. fillPlayerField \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (void). \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0442\u043e\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043b\u043e\u0433\u0438\u043a\u0430 \u043f\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044e \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u043a\u043e\u0440\u0430\u0431\u043b\u044f \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 playerField \u043d\u043e\u0432\u043e\u0433\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u044f. <\/p>\n<p>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439. \u0411\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0449\u0430\u0442\u044c \u043a\u043e\u0440\u0430\u0431\u043b\u0438 \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e \u043f\u0430\u043b\u0443\u0431, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u043c \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u043c \u0447\u0435\u0442\u044b\u0440\u0451\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c, \u0437\u0430\u0442\u0435\u043c \u0432\u0441\u0435 \u0442\u0440\u0451\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u0438, \u0432\u0441\u0435 \u0434\u0432\u0443\u0445\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0435 \u043a\u043e\u0440\u0430\u0431\u043b\u0438 \u0438 \u0432\u0441\u0435 \u043e\u0434\u043d\u043e\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0435. \u041f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u043e\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442\u044b \u043d\u0430\u0447\u0430\u043b\u0430 \u043a\u043e\u0440\u0430\u0431\u043b\u044f \u0438 \u0435\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u0435 (\u0441\u043c. \u0431\u0438\u0437\u043d\u0435\u0441-\u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u2116 6) &#8212; \u043f\u043e \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u0438 \u0438\u043b\u0438 \u043f\u043e \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438.<\/p>\n<p>\u041f\u0440\u0438\u0432\u0435\u0434\u0443 \u0432\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043e\u0436\u0438\u0434\u0430\u0435\u043c \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043f\u043e\u0441\u043b\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430 fillPlayerField:<\/p>\n<pre><code>\u0420\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c 4-\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c: 1 Input x coord:  1 Input y coord:  1 1. Horizontal; 2. Vertical ? 1<\/code><\/pre>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c. \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0438\u043c\u0435\u0435\u043c:<\/p>\n<pre><code class=\"java\">private static void fillPlayerField(char[][] playerField) {     \/\/ your code will be here }<\/code><\/pre>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043a\u043e\u0440\u0430\u0431\u043b\u0438 \u0441 \u043f\u0430\u043b\u0443\u0431\u0430\u043c\u0438 \u043e\u0442 4 \u0434\u043e 1. \u0417\u0434\u0435\u0441\u044c \u0434\u0435\u043b\u043e \u0438\u0434\u0451\u0442 \u043a \u0446\u0438\u043a\u043b\u0443. \u041f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0435\u0433\u043e \u043f\u0430\u0444\u043e\u0441\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c for. \u0417\u0430\u043c\u0435\u0442\u0438\u043c, \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0441 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u043f\u0430\u043b\u0443\u0431 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0435\u0449\u0451 \u043a\u0430\u043a-\u0442\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0433 \u0440\u0430\u0437\u043c\u0435\u0441\u0442\u0438\u0442\u044c \u043b\u0438\u0448\u044c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0441 \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u043b\u0443\u0431 (\u0441\u043c. \u0431\u0438\u0437\u043d\u0435\u0441 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u21165) &#8212; \u044d\u0442\u0430 \u0437\u0430\u0434\u0430\u0447\u0430 \u0442\u0430\u043a\u0436\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u0440\u0435\u0448\u0430\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0446\u0438\u043a\u043b\u0430 &#8212; \u0431\u0435\u0437 \u043f\u0430\u0444\u043e\u0441\u0430 \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c for.<\/p>\n<pre><code class=\"java\">private static void fillPlayerField(char[][] playerField) { \t\t\/\/ i - \u0441\u0447\u0451\u0442\u0447\u0438\u043a \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u043b\u0443\u0431 \u0443 \u043a\u043e\u0440\u0430\u0431\u043b\u044f     \/\/ \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0440\u0430\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0443 \u0441 \u043a\u043e\u0440\u0430\u0431\u043b\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e 4 \u043f\u0430\u043b\u0443\u0431\u044b, \u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u043c \u043a\u043e\u0440\u0430\u0431\u043b\u044f\u043c\u0438 \u0441 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043b\u0443\u0431\u043e\u0439     for (int i = 4; i &gt;= 1; i--) {       \t\/\/ \u0441\u043c. \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u043e\u0434\u0435 \u043f\u043e\u0434 \u044d\u0442\u043e\u0439 \u0432\u0441\u0442\u0430\u0432\u043a\u043e\u0439     \t\tfor (int k = i; k &lt;= 5 - i; k++) {           \tSystem.out.println(\"\u0420\u0430\u0441\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \" + i + \"-\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0439 \u043a\u043e\u0440\u0430\u0431\u043b\u044c. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0441\u0441\u0442\u0430\u0432\u0438\u0442\u044c: \" + (q + 1));         \t\t\/\/ some your code here         }     } } <\/code><\/pre>\n<p>\u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e \u043a\u043e\u0434\u0435:<\/p>\n<p>\u041d\u0430 5 \u0441\u0442\u0440\u043e\u0447\u043a\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0446\u0438\u043a\u043b for (int k = 0; k &lt;= 5 &#8212; i; k++). \u041e\u0431\u044a\u044f\u0441\u043d\u044e, \u043e\u0442\u043a\u0443\u0434\u0430 \u0442\u0430\u043a\u0430\u044f \u043c\u0430\u0433\u0438\u044f. \u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043a\u0430\u043a-\u0442\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 (\u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043f\u0430\u043b\u0443\u0431) \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c. <\/p>\n<p>\u041c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0437\u0430\u0445\u0430\u0440\u0434\u043a\u043e\u0434\u0438\u043c \u0447\u0442\u043e-\u0442\u043e \u0432 \u0434\u0443\u0445\u0435:<\/p>\n<pre><code class=\"java\">int[][] shipTypeAmount = {{1, 4}, {2, 3}, {3, 2}, {4, 1}};<\/code><\/pre>\n<p>\u041c\u044b \u0431\u044b \u0432 \u043f\u0435\u0440\u0432\u043e\u043c \u0446\u0438\u043a\u043b\u0435 (\u0441\u043c. \u0441\u0442\u0440\u043e\u043a\u0443 4) \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u043b\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u043b\u0443\u0431, \u043f\u043e\u0442\u043e\u043c \u0438\u0441\u043a\u0430\u043b\u0438 \u0431\u044b \u0432 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u043e\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0435, \u043a\u0430\u043a\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0442\u0438\u043f\u0443. \u041d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434, \u0442\u0430\u043a\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435, \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e, \u0435\u0441\u043b\u0438 \u0431\u044b \u043c\u044b \u043f\u0438\u0441\u0430\u043b\u0438 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u0443\u044e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0431\u044b \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0430\u043a, \u043d\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0442\u0430\u043a\u0430\u044f \u043a\u0440\u0430\u0441\u043e\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0439 &#8212; \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u044d\u0442\u043e \u043a\u0430\u043a \u0437\u0430\u0434\u0430\u0447\u0443 \u0441\u043e \u0437\u0432\u0451\u0437\u0434\u043e\u0447\u043a\u043e\u0439, \u0434\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0437\u0430\u0445\u043e\u0447\u0435\u0442 &#171;\u043f\u0440\u0438\u0447\u0435\u0441\u0430\u0442\u044c&#187; \u0441\u0432\u043e\u0439 \u043a\u043e\u0434. <\/p>\n<p>\u042f \u0436\u0435 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0441\u0443\u043c\u043c\u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043f\u0430\u043b\u0443\u0431 &#8212; \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u0430\u044f. \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, . \u041f\u043e\u044d\u0442\u043e\u043c\u0443, \u0437\u043d\u0430\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0430\u043b\u0443\u0431 \u0443 \u043a\u043e\u0440\u0430\u0431\u043b\u044f (\u0437\u043d\u0430\u044f \u0442\u0438\u043f \u043a\u043e\u0440\u0430\u0431\u043b\u044f), \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0440\u0430\u0431\u043b\u0435\u0439 \u0442\u0430\u043a\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043e \u043e\u0434\u043d\u0438\u043c \u0438\u0433\u0440\u0430\u043a\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, &#8212; \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0433\u0440\u043e\u043a \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c 4 \u043e\u0434\u043d\u043e\u043f\u0430\u043b\u0443\u0431\u043d\u044b\u0445 \u043a\u043e\u0440\u0430\u0431\u043b\u044f. \u0412 \u0446\u0438\u043a\u043b\u0435 for \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0435 6 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0443\u0441\u043b\u043e\u0432\u0438\u044f \u0446\u0438\u043a\u043b\u0430 &#171;\u043b\u0430\u0439\u0442\u043e\u0432\u044b\u043c&#187; \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c &#8212; \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u044d\u0442\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0435\u043b\u043e \u0437\u0430 \u043c\u0430\u043b\u044b\u043c &#8212; \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u043b\u043e\u0433\u0438\u043a\u0443 \u043f\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u044e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438 \u0437\u0430\u043f\u0438\u0441\u044c \u043a\u043e\u0440\u0430\u0431\u043b\u044f \u0432 \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<pre><code class=\"java\">private static void fillPlayerField(char[][] playerField) {         for (int i = 4; i &gt;= 1; i--) {             \/\/<\/code><\/pre>\n<p><\/br><\/br><\/p>\n<\/li>\n<\/ol>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-325052","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=325052"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/325052\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=325052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=325052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=325052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}