{"id":308193,"date":"2020-08-08T21:00:27","date_gmt":"2020-08-08T21:00:27","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=308193"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2020-08-08T21:00:27","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=308193","title":{"rendered":"\u0418\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0435\u043c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0438\u043b\u0438 \u043f\u0438\u0448\u0435\u043c \u043f\u0435\u0440\u0441\u0435\u043f\u0442\u0440\u043e\u043d \u043d\u0430 \u0421++. \u0427\u0430\u0441\u0442\u044c 1 \u0438 2"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/514372\/\">\n<p><h1>\u0418\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0435\u043c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0438\u043b\u0438 \u043f\u0438\u0448\u0435\u043c \u043f\u0435\u0440\u0441\u0435\u043f\u0442\u0440\u043e\u043d \u043d\u0430 C++. \u0427\u0430\u0441\u0442\u044c 1<\/h1>\n<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0441\u0435\u043f\u0442\u0440\u043e\u043d\u0430 \u043d\u0430 C++<\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/w4\/dl\/fi\/w4dlfihcpjmca4imvsp80fw5i3i.png\" height=\"200\" width=\"320\"\/><br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<p><h3>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>  <font>\u0412\u0441\u0435\u043c \u043f\u0440\u0438\u0432\u0435\u0442, \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u0441\u0442\u0435 \u044f \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0432\u0430\u043c\u0438 \u043c\u043e\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u043c \u043e\u043f\u044b\u0442\u043e\u043c \u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439. \u0421\u0442\u0430\u0442\u0435\u0439 \u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439(\u041d\u0421 \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c), \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043c\u043d\u043e\u0433\u043e \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435, \u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0447\u0443\u0436\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0431\u0435\u0437 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0441\u0443\u0442\u0438 \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u044b \u044f \u043d\u0435 \u0445\u043e\u0447\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441 \u043d\u0443\u043b\u044f.<\/p>\n<p>  \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u043e\u043f\u0438\u0448\u0443 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0442. \u0447\u0430\u0441\u0442\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f. \u0412\u0441\u044f \u0442\u0435\u043e\u0440\u0438\u044f \u0432\u0437\u044f\u0442\u0430 \u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0430\u0439\u0442\u043e\u0432, \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0441 \u0432\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438. <\/p>\n<p>  \u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438.<br \/>  <\/font><\/p>\n<h3>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u0442\u0435\u043e\u0440\u0438\u0438<\/h3>\n<p>  <\/p>\n<p><font>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u044f \u043d\u0435 \u043f\u0440\u0435\u0442\u0435\u043d\u0434\u0443\u044e \u043d\u0430 \u0437\u0432\u0430\u043d\u0438\u0435 \u00ab\u0441\u0430\u043c\u044b\u0439 \u043b\u0443\u0447\u0448\u0438\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f\u00bb, \u044f \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0438 \u0441\u0432\u043e\u0438 \u0438\u0434\u0435\u0438. \u0422\u0430\u043a\u0436\u0435 \u044f \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0442\u043a\u0440\u044b\u0442 \u0434\u043b\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u043a\u0440\u0438\u0442\u0438\u043a\u0438 \u0438 \u0441\u043e\u0432\u0435\u0442\u043e\u0432 \u043f\u043e \u043a\u043e\u0434\u0443, \u044d\u0442\u043e \u0432\u0430\u0436\u043d\u043e, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u043e.<\/font><\/p>\n<p>  <\/p>\n<p><font> \u0418\u0437\u0443\u0447\u0438\u0432 \u0432\u0438\u0434\u044b \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u0435\u0439 \u043d\u0430 \u0432\u0438\u043a\u0438\u043f\u0435\u0434\u0438\u0438, \u044f \u0432\u044b\u0431\u0440\u0430\u043b \u043f\u0435\u0440\u0441\u0435\u043f\u0442\u0440\u043e\u043d \u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u043c \u043a\u0430\u043a \u0441\u0445\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0435\u0440\u0441\u0435\u043f\u0442\u0440\u043e\u043d<\/font> <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/zd\/qa\/6k\/zdqa6kbejfsqktsrcthkmho51qe.png\" \/><\/div>\n<\/p>\n<p>  <font>\u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c \u043a\u0430\u0436\u0434\u044b\u0439 \u043d\u0435\u0439\u0440\u043e\u043d \u0441\u043b\u043e\u044f \u0441\u0432\u044f\u0437\u0430\u043d \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0433\u043e \u0441\u043b\u043e\u044f. \u0410 \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b \u044d\u0442\u043e\u0439 \u0441\u0435\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u043c.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0443\u0437\u043b\u0430 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e. \u0414\u0430\u043d\u043d\u0430\u044f \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430 \u043a\u0430\u043a \u043d\u0435\u043b\u044c\u0437\u044f \u043b\u0443\u0447\u0448\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442 \u0441\u043c\u044b\u0441\u043b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u0430:<\/font> <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dl\/lb\/4f\/dllb4fkex2pllmibnfb4rwafpli.png\" \/><\/div>\n<p>  <font>\u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0447\u0442\u043e \u0432 \u043d\u0430\u0448 \u043d\u0435\u0439\u0440\u043e\u043d \u043f\u0440\u0438\u0445\u043e\u0434\u044f\u0442 \u0442\u0440\u0438 \u0441\u0438\u0433\u043d\u0430\u043b\u0430(\u04451, \u04452, \u04453), \u0442\u043e\u0433\u0434\u0430 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f u \u043d\u0435\u0439\u0440\u043e\u043d \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0441\u0438\u0433\u043d\u0430\u043b\u043e\u0432 \u043d\u0430 \u0432\u0435\u0441\u0430 \u0432\u0445\u043e\u0434\u043e\u0432 (w1, w2, w3), \u0438\u043b\u0438 \u043f\u0440\u043e\u0449\u0435 \u0433\u043e\u0432\u043e\u0440\u044f:<br \/>   u = x1*w1 + x2*w2 + x3*w3<br \/>  \u0412 \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u0449\u0435\u043c \u0432\u0438\u0434\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0442\u0430\u043a:<br \/>  <\/font> <\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jp\/te\/kv\/jptekvw1oguhxn7nmgyfttb9xeq.png\" \/><\/div>\n<p>  <\/p>\n<p><font>\u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e\u0431 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0435\u0439\u0440\u043e\u043d\u0430. \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 \u043e\u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u0430 \u043a\u0430\u043a y(u), \u0433\u0434\u0435 u \u2013 \u0443\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0430\u044f \u043d\u0430\u043c \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430. \u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043d\u0435\u0439\u0440\u043e\u043d\u0430 \u0438 \u043f\u043e\u0439\u0434\u0451\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432.<\/p>\n<p>  \u0410\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043b\u044e\u0431\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u0438\u043c\u0435\u044e\u0449\u0430\u044f \u043f\u0440\u0435\u0434\u0435\u043b, \u0442.\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0438, \u043a \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043e\u043d\u0430 \u0441\u0442\u0440\u0435\u043c\u0438\u0442\u0441\u044f, \u043d\u043e \u043d\u0438\u043a\u043e\u0433\u0434\u0430 \u043d\u0435 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0435\u0442. \u0422\u0430\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043e\u0433\u0440\u043e\u043c\u043d\u043e\u0435 \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e, \u043d\u043e \u043c\u044b \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u043e\u0439 \u2013 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u043e\u0439(\u043a\u0441\u0442\u0430\u0442\u0438, \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0430 \u043d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435). \u0412\u043e\u0442 \u0442\u0430\u043a \u043e\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043d\u0430\u0448\u0438\u0445 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445: <\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/pt\/8o\/46\/pt8o4673z2wsw3tukp_3kwwruk8.png\"\/><\/p>\n<p>  \u0414\u0430\u043d\u043d\u043e\u0435 \u0447\u0443\u0434\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u043e\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (0; 1), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043d\u0430\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. \u0410 \u0432\u0435\u043b\u0438\u0447\u0438\u043d\u0430 y(u) \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043d\u0435\u0439\u0440\u043e\u043d\u0430.<\/font><\/p>\n<p>  <\/p>\n<p><font>\u0424\u0443\u0445, \u043d\u0443 \u0432\u0440\u043e\u0434\u0435 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0442. \u0447\u0430\u0441\u0442\u044c\u044e \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u043b\u0438\u0441\u044c, \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0438\u043c \u043a \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435.<br \/>  \u041d\u0430 \u043b\u0438\u0441\u0442\u0435 \u0431\u0443\u043c\u0430\u0433\u0438 \u0432\u0441\u0451 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043c\u0435\u0447\u0430\u0442\u0435\u043b\u044c\u043d\u043e, \u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0434\u0435\u043b\u043e \u0434\u043e\u0448\u043b\u043e \u0434\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430, \u0442\u043e \u0432\u043e\u0437\u043d\u0438\u043a \u0432\u043e\u043f\u0440\u043e\u0441 \u0441 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432.<\/p>\n<p>  \u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u041d\u0421 \u043f\u043e \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044e \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043d\u0435 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u0430\u044f, \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u043b\u0435\u0433\u043a\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u0448\u0430\u0433\u0430\u0442\u044c \u0431\u0443\u043a\u0432\u0430\u043b\u044c\u043d\u043e \u043f\u043e \u0441\u043b\u043e\u044f\u043c \u0441\u0435\u0442\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u044f \u041d\u0421 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u0432\u0441\u0451, \u0447\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u0441\u0435\u0442\u0438, \u0432 \u0442\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u0438 \u043e\u0448\u0438\u0431\u043a\u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u0430 (\u043e\u0431 \u043e\u0431\u0443\u0447\u0435\u043d\u0438\u0438 \u0438 \u0435\u0433\u043e \u0442\u043e\u043d\u043a\u043e\u0441\u0442\u044f\u0445 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438).<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c 2 \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u0430: \u043e\u0434\u0438\u043d \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u0430, \u0432\u0442\u043e\u0440\u043e\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432\u0435\u0441\u043e\u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0432\u044f\u0437\u0438.<\/p>\n<p>  \u041e\u0431\u044a\u044f\u0441\u043d\u044e \u0438\u0434\u0435\u044e \u043d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0430\u0445:<\/font><\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/yc\/uj\/8l\/ycuj8lo18mp-8huc8o3s3qrz0jq.png\" height=\"100\" width=\"160\"\/><\/p>\n<p>  <font>\u041f\u0443\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c 8 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u0432 \u0441\u043b\u043e\u0435 (\u0441 n1 \u043f\u043e n8), \u0430 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0442\u043e\u0439 \u0441\u0430\u043c\u043e\u0439 \u0441\u0443\u043c\u043c\u044b \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0439 u, \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0438\u0437 \u0441\u0438\u0433\u043c\u043e\u0438\u0434\u044b \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u00aby(u)\u00bb \u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u00aberr\u00bb, \u0442\u043e\u0433\u0434\u0430 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c (\u043c\u0430\u0442\u0440\u0438\u0446\u0435\u0439). \u0421\u043c\u044b\u0441\u043b \u043f\u043e\u043b\u044f \u00aberr\u00bb \u043f\u043e\u044f\u0441\u043d\u044e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438. <\/p>\n<p>  \u041d\u043e \u0442\u0430\u043a\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u043b\u0438\u0448\u044c \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f, \u0430 \u0441\u043b\u043e\u0451\u0432 \u0432 \u0441\u0435\u0442\u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u0438\u043c \u0431\u043e\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u043e\u0434\u0438\u043d.<\/font><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/7g\/vo\/-3\/7gvo-3705rdvnpv-urvltlwik5m.png\" height=\"100\" width=\"160\"\/><\/p>\n<p>  <font>\u0422\u043e\u0433\u0434\u0430 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u043a \u043d\u0430\u043c \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u0442\u0440\u0435\u0442\u044c\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0430 \u043d\u043e\u043c\u0435\u0440 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u044f \u0438 \u0431\u0443\u0434\u0435\u0442 \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u044d\u0442\u043e\u0433\u043e \u0441\u043b\u043e\u044f.<\/font><\/p>\n<p>  <\/p>\n<p><font>\u0417\u0434\u0435\u0441\u044c \u0441\u0442\u043e\u0438\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0442\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435. \u041c\u043e\u0436\u043d\u043e \u043a\u0440\u0443\u0442\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434, \u043e\u0431\u044a\u044f\u0432\u0438\u0432 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043f\u0430\u043c\u044f\u0442\u044c\u044e. \u041d\u043e \u0442\u0443\u0442 \u043c\u044b \u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043e\u0434, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0442\u044c \u0432 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0441\u0442\u0430\u0442\u044c\u0438.<\/font><\/p>\n<p>  <\/p>\n<p><font>\u041d\u0443 \u0432\u0440\u043e\u0434\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u044b \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043d\u0443\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043d\u0435\u0439\u0440\u043e\u043d\u0430\u0445 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u043e\u0431\u044a\u044f\u0441\u043d\u0438\u0442\u044c. \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435\u043c \u0432\u0435\u0441\u043e\u0432 \u0441\u0432\u044f\u0437\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u0439\u0440\u043e\u043d\u0430\u043c\u0438.<\/font><\/p>\n<p>  <\/p>\n<p><font>\u0412\u043e\u0437\u044c\u043c\u0451\u043c \u0434\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0432\u043e\u0442 \u0442\u0430\u043a\u0443\u044e \u0441\u0435\u0442\u044c:<\/font><\/p>\n<p>.<\/p>\n<p><div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/dh\/pq\/nj\/dhpqnj5vsmliqx3nil68ybs-ozw.png\" \/><\/div>\n<\/p>\n<p>  <\/p>\n<p><font>\u0423\u0436\u0435 \u0437\u043d\u0430\u044f, \u043a\u0430\u043a \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435\u0439\u0440\u043e\u043d\u044b, \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043f\u043e\u0434\u043e\u0431\u043d\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0434\u043b\u044f \u0432\u0435\u0441\u043e\u0432:<\/font><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/jn\/9j\/wv\/jn9jwvemh_pbyef6cfsaevtu-u8.png\"\/><\/p>\n<p><font>\u0415\u0451 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u0430\u044f: \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u0435\u0441\u0430 \u043c\u0435\u0436\u0434\u0443 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u043c N1 \u0438 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u043c n1 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442\u0441\u044f \u0432 \u044f\u0447\u0435\u0439\u043a\u0435 w1-1, \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0432\u0435\u0441\u0430\u043c\u0438. \u041d\u043e \u043e\u043f\u044f\u0442\u044c \u0436\u0435, \u0442\u0430\u043a\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u0440\u0438\u0433\u043e\u0434\u043d\u0430 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0432\u0435\u0441\u043e\u0432 \u0442\u043e\u043b\u044c\u043a\u043e \u043c\u0435\u0436\u0434\u0443 \u0434\u0432\u0443\u043c\u044f \u043f\u0435\u0440\u0432\u044b\u043c\u0438 \u0441\u043b\u043e\u044f\u043c\u0438, \u043d\u043e \u0432\u0435\u0434\u044c \u0432 \u0441\u0435\u0442\u0438 \u0435\u0441\u0442\u044c \u0435\u0449\u0451 \u0432\u0435\u0441\u0430 \u043c\u0435\u0436\u0434\u0443 \u0432\u0442\u043e\u0440\u044b\u043c \u0438 \u0442\u0440\u0435\u0442\u044c\u0438\u043c \u0441\u043b\u043e\u044f\u043c\u0438. \u0412\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u043c \u043f\u0440\u0438\u0451\u043c\u043e\u043c \u2013 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u043e\u0432\u043e\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432, \u043d\u043e \u0441 \u043e\u0433\u043e\u0432\u043e\u0440\u043a\u043e\u0439: \u043f\u0443\u0441\u043a\u0430\u0439 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u0440\u043e\u0447\u0435\u043a \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u044e\u0442 \u0441\u043b\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u0441\u043b\u0435\u0432\u0430 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u00ab\u043f\u0443\u0447\u043a\u0430\u00bb \u0432\u0435\u0441\u043e\u0432, \u0430 \u0441\u043b\u043e\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u0441\u043f\u0440\u0430\u0432\u0430 \u0432\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432.<\/font><\/p>\n<p>  <\/p>\n<p><font>\u0422\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u00ab\u043f\u0443\u0447\u043a\u0430\u00bb \u0432\u0435\u0441\u043e\u0432 \u0442\u0430\u043a\u0443\u044e \u0442\u0430\u0431\u043b\u0438\u0446\u0443:<\/font><\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/4g\/x4\/es\/4gx4eskib1c-mocetk-qzmmlxng.png\"\/><\/p>\n<p><font>\u0410 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0432\u0435\u0441\u043e\u0432 \u0442\u0435\u043f\u0435\u0440\u044c \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/font><\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/l-\/o7\/ac\/l-o7acvlaorq1rkym2_xjpwnjti.png\" height=\"100\" width=\"160\"\/><\/p>\n<p><font>\u041f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u0432\u0435\u0441\u043e\u0432 \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0432\u044b\u0441\u043e\u043a\u043e\u0433\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0430 \u043f\u0430\u043c\u044f\u0442\u0438 \u00ab\u0432\u043f\u0443\u0441\u0442\u0443\u044e\u00bb, \u0442.\u043a. \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u043d\u0430 \u0441\u043b\u043e\u044f\u0445 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u043e \u043b\u044e\u0431\u044b\u043c, \u043d\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u0434\u0435\u043b\u0430\u0435\u043c \u00ab\u0438\u043c\u0435\u044e\u0442 \u0444\u043e\u0440\u043c\u0443\u00bb \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u0435\u043f\u0438\u043f\u0435\u0434\u0430, \u0438\u0437-\u0437\u0430 \u0447\u0435\u0433\u043e \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0443\u0441\u0442\u044b\u0445 \u044f\u0447\u0435\u0435\u043a, \u043d\u043e \u043f\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0440\u0435\u0437\u0435\u0440\u0432\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0430\u043c\u044f\u0442\u044c. \u0418\u043c\u0435\u043d\u043d\u043e \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044f \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u044e \u0441\u0432\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0438 \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0432\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445)).<\/font><\/p>\n<p>  <\/p>\n<h3>\u0418 \u0432 \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438<\/h3>\n<p>  <font>\u0410 \u043d\u0430 \u044d\u0442\u043e\u043c \u043f\u0435\u0440\u0432\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e. <\/font><\/p>\n<p><h1>\u0418\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0435\u043c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0438\u043b\u0438 \u043f\u0438\u0448\u0435\u043c \u043f\u0435\u0440\u0441\u0435\u043f\u0442\u0440\u043e\u043d \u043d\u0430 C++. \u0427\u0430\u0441\u0442\u044c 2<\/h1>\n<\/p>\n<p>  <\/p>\n<p>\u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0438\u0434\u0435\u0438, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 \u043f\u0440\u043e\u0448\u043b\u044b\u0439 \u0440\u0430\u0437.<\/p>\n<p>  <\/p>\n<h3>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>  <\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b \u043d\u0430 \u0432\u0430\u0448 \u0441\u0443\u0434 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0434\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0441\u0435\u043f\u0442\u0440\u043e\u043d. \u041d\u0430 \u044d\u0442\u043e\u0442 \u0440\u0430\u0437 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0438\u0441\u0430\u0442\u044c \u043a\u043e\u0434.<\/p>\n<p>  <\/p>\n<p>\u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438!<\/p>\n<p>  <\/p>\n<h3>\u041e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u0435 header \u2014 \u0444\u0430\u0439\u043b\u0430<\/h3>\n<p>  <\/p>\n<p>\u0414\u0430\u0431\u044b \u043d\u0430\u0448 \u043a\u043e\u0434 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445, \u043e\u0444\u043e\u0440\u043c\u0438\u043c \u0435\u0433\u043e \u043a\u0430\u043a \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c header \u2014 \u0444\u0430\u0439\u043b (\u043f\u0443\u0441\u0442\u044c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u00abneuro.h\u00bb). \u0412\u043d\u0443\u0442\u0440\u0438 \u043d\u0435\u0433\u043e \u043e\u043f\u0438\u0448\u0435\u043c \u043a\u043b\u0430\u0441\u0441 \u0441 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u043c\u0438 \u043c\u0435\u0442\u043e\u0434\u0430\u043c\u0438:<\/p>\n<pre><code class=\"cpp\">class NeuralNet { public:     NeuralNet(uint8_t L, uint16_t *n);     void Do_it(uint16_t size, double *data);     void getResult(uint16_t size, double* data);     void learnBackpropagation(double* data, double* ans, double acs, double k); private:     vector&lt;vector&lt;vector&lt;double&gt;&gt;&gt; neurons;     vector&lt;vector&lt;vector&lt;double&gt;&gt;&gt; weights;     uint8_t numLayers;     vector&lt;double&gt; neuronsInLayers;     double Func(double in);     double Func_p(double in);     uint32_t MaxEl(uint16_t size, uint16_t *arr);     void CreateNeurons(uint8_t L, uint16_t *n);     void CreateWeights(uint8_t L, uint16_t *n);  };<\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u044f \u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u044b, \u043d\u043e \u0438 \u043f\u0440\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0443\u044e \u043e\u0431\u0432\u044f\u0437\u043a\u0443 header&#8217;\u0430 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c). \u0412\u0441\u0442\u0430\u0432\u0438\u043c \u0432 \u043d\u0430\u0447\u0430\u043b\u043e \u0444\u0430\u0439\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"cpp\"> \/\/\u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0438\u0436\u0435 \u043d\u0443\u0436\u043d\u044b, \u0447\u0442\u043e\u0431\u044b \u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0443 \u043e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430, \u0435\u0441\u043b\u0438 \u0440\u0430\u043d\u0435\u0435 \u043e\u043d \u043d\u0435 \u0431\u044b\u043b \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442 \u0432 \u043a\u043e\u0434\u0435 #ifndef NEURO_H #define NEURO_H  #include &lt;vector&gt; \/\/\u0444\u0430\u0439\u043b \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\u043c\u0438 #include &lt;math.h&gt; \/\/\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u043e\u0439, \u043d\u0443\u0436\u043d\u0430 \u0434\u043b\u044f \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 #include &lt;stdint.h&gt; \/\/\u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0438\u043f\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442 \u043e\u0431\u044a\u0451\u043c \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438 \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0433\u043e \u043d\u0435 \u0441\u0430\u043c\u043e\u0433\u043e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430. <\/code><\/pre>\n<p>  <\/p>\n<p>\u0420\u0430\u0437\u0431\u0435\u0440\u0451\u043c\u0441\u044f \u0441 \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u043c\u0438 \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">NeuralNet(uint8_t L, uint16_t *n);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u041d\u0421, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043a\u043e\u043b-\u0432\u043e \u0441\u043b\u043e\u0451\u0432 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u043c \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u043b\u043e\u0451\u0432 \u0432 \u0432\u0438\u0434\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void Do_it(uint16_t size, double *data);<\/code><\/pre>\n<p>  <\/p>\n<p>\u041d\u0435 \u0434\u043e\u043b\u0433\u043e \u0434\u0443\u043c\u0430\u043b \u043d\u0430\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438)), \u043d\u043e \u0438\u043c\u0435\u043d\u043d\u043e \u043e\u043d\u0430 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u043f\u0440\u044f\u043c\u043e\u0435 \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u0441\u0435\u0442\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void getResult(uint16_t size, double* data);<\/code><\/pre>\n<p>  <\/p>\n<p>\u042d\u0442\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0441\u043b\u043e\u044f \u0441\u0435\u0442\u0438.<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">void learnBackpropagation(double* data, double* ans, double acs, double k);<\/code><\/pre>\n<p>  <\/p>\n<p>\u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u043d\u0435\u0439\u0440\u043e\u0441\u0435\u0442\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043c\u0435\u0442\u043e\u0434 \u043e\u0431\u0440\u0430\u0442\u043d\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0448\u0438\u0431\u043a\u0438.<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u043a\u043b\u0430\u0441\u0441\u0430 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f, \u0441\u0435\u0439\u0447\u0430\u0441 \u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u043f\u0440\u0438\u0432\u0430\u0442\u043d\u044b\u0445 \u043f\u043e\u043b\u044f\u0445 \u043a\u043b\u0430\u0441\u0441\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\">     vector&lt;vector&lt;vector&lt;double&gt;&gt;&gt; neurons; \/\/\u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0441 \u043d\u0435\u0439\u0440\u043e\u043d\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435     vector&lt;vector&lt;vector&lt;double&gt;&gt;&gt; weights; \/\/\u0442\u0440\u0451\u0445\u043c\u0435\u0440\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0441 \u0432\u0435\u0441\u0430\u043c\u0438, \u0435\u0433\u043e \u043c\u044b \u0442\u043e\u0436\u0435 \u043e\u043f\u0438\u0441\u0430\u043b\u0438 \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438     uint8_t numLayers; \/\/\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0451\u0432 \u0441\u0435\u0442\u0438     vector&lt;double&gt; neuronsInLayers; \/\/\u0432\u0435\u043a\u0442\u043e\u0440, \u0445\u0440\u0430\u043d\u044f\u0449\u0438\u0439 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0441\u043b\u043e\u0435 \/* \u0412\u043e\u043e\u0431\u0449\u0435 \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u0438 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0438 \u043d\u0435 \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0442\u044c, \u0430 \u0431\u0440\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u043b\u043e\u0451\u0432 \u0438 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432, \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0432\u0435\u0441\u043e\u0432 \u0438 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432, \u043d\u043e \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u043c\u044b \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0437\u0430\u0442\u0440\u0430\u0433\u0438\u0432\u0430\u0435\u043c \u0432\u043e\u043f\u0440\u043e\u0441\u044b \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438, \u044d\u0442\u0438\u043c \u0437\u0430\u0439\u043c\u0451\u043c\u0441\u044f \u043f\u043e\u0437\u0436\u0435 *\/     double Func(double in); \/\/ \u0442\u0430 \u0441\u0430\u043c\u0430\u044f \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u043e\u043d\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f     double Func_p(double in); \/\/ \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u043d\u0430\u044f \u0442\u043e\u0439 \u0441\u0430\u043c\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438     uint32_t MaxEl(uint16_t size, uint16_t *arr);\/\/ \u043f\u0440\u043e\u0441\u0442\u0435\u043d\u044c\u043a\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0438\u0441\u043a\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u0430 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435     void CreateNeurons(uint8_t L, uint16_t *n);\/\/ \u044d\u0442\u0443 \u0438 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u0441 \u0432\u0435\u0441\u0430\u043c\u0438 \u0438 \u043d\u0435\u0439\u0440\u043e\u043d\u0430\u043c\u0438     void CreateWeights(uint8_t L, uint16_t *n); <\/code><\/pre>\n<p>  <\/p>\n<p>\u0417\u0430\u043a\u043e\u043d\u0447\u0438\u043c header \u2014 \u0444\u0430\u0439\u043b \u0441\u0442\u0440\u043e\u043a\u043e\u0439: <\/p>\n<pre><code class=\"cpp\">#endif<\/code><\/pre>\n<\/p>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u0437\u0430\u0432\u0435\u0440\u0448\u0438\u043c header \u0438 \u043e\u0441\u0442\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u043f\u043e\u043a\u043e\u0435. \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u0430\u043c\u043e\u043c\u0443 \u0432\u043a\u0443\u0441\u043d\u043e\u043c\u0443 \u2014 source \u2014 \u0444\u0430\u0439\u043b\u0443).<\/p>\n<p>  <\/p>\n<h3>\u041a\u043e\u0434 \u0432\u043d\u0443\u0442\u0440\u0438 source \u2014 \u0444\u0430\u0439\u043b\u0430<\/h3>\n<p>  <\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u0431\u0443\u0434\u0435\u0442 \u0432 \u043a\u043e\u043d\u0446\u0435, \u043c\u044b \u0436\u0435 \u0440\u0430\u0437\u0431\u0435\u0440\u0451\u043c \u0441\u0430\u043c\u044b\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435 \u0435\u0433\u043e \u043c\u0435\u0441\u0442\u0430.<\/p>\n<p>  <\/p>\n<p>\u041a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043a\u043b\u0430\u0441\u0441\u0430 \u0438\u0437\u043d\u0443\u0442\u0440\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\"> NeuralNet::NeuralNet(uint8_t L, uint16_t *n) { \tCreateNeurons(L, n); \/\/\u043f\u0435\u0440\u0435\u0440\u0430\u0437\u043c\u0435\u0447\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \tCreateWeights(L, n); \/\/\u043f\u0435\u0440\u0435\u0440\u0430\u0437\u043c\u0435\u0447\u0430\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u043e \u0432\u0435\u0441\u043e\u0432 \tthis-&gt;numLayers = L; \tthis-&gt;neuronsInLayers.resize(L); \tfor (uint8_t l = 0; l &lt; L; l++)this-&gt;neuronsInLayers[l] = n[l]; \/\/\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0442\u0440\u0451\u0445 \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u0430 } <\/code><\/pre>\n<p>  <\/p>\n<p>\u041f\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0440\u044f\u043c\u043e\u0433\u043e \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c \u043e\u0441\u043e\u0431\u043e \u043d\u0435\u0447\u0435\u0433\u043e, \u043f\u0440\u043e\u0441\u0442\u043e \u0431\u0435\u0440\u0451\u043c \u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0441\u0451 \u043e\u0442 \u0441\u043b\u043e\u044f \u043a \u0441\u043b\u043e\u044e:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\"> void NeuralNet::Do_it(uint16_t size, double *data) { \tfor (int n = 0; n &lt; size; n++) { \/\/ \u0442\u0443\u0442 \u0432\u043d\u043e\u0441\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435\u0439\u0440\u043e\u043d\u044b \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u043b\u043e\u044f \t\tneurons[n][0][0] = data[n]; \/\/ \u043d\u0443\u043b\u0435\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \t\tneurons[n][1][0] = Func(neurons[n][0][0]); \/\/ \u043f\u0435\u0440\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0442 \u0432\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0432 \u043d\u0435\u0439\u0440\u043e\u043d \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \t} \tfor (int L = 1; L &lt; numLayers; L++) { \/\/ \u0430 \u0437\u0434\u0435\u0441\u044c \u043e\u0442 \u0441\u043b\u043e\u044f \u043a \u0441\u043b\u043e\u044e \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0432\u0445\u043e\u0434\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u0430 \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0445 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \t\tfor (int N = 0; N &lt; neuronsInLayers[L]; N++) {  \t\t\tdouble input = 0; \t\t\tfor (int lastN = 0; lastN &lt; neuronsInLayers[L - 1]; lastN++) {\/\/ \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0435\u0439\u0440\u043e\u043d\u0430 \u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0441\u0443\u043c\u043c\u0443 \u0435\u0433\u043e \u0432\u0445\u043e\u0434\u043e\u0432 \u0434\u043b\u044f \u043e\u0442\u043f\u0440\u0430\u0432\u043a\u0438 \u0432 \u0430\u043a\u0442\u0438\u0432\u0430\u0446\u0438\u043e\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \t\t\t\tinput += neurons[lastN][1][L - 1] * weights[lastN][N][L - 1]; \t\t\t} \t\t\tneurons[N][0][L] = input; \t\t\tneurons[N][1][L] = Func(input); \t\t} \t} } <\/code><\/pre>\n<p>  <\/p>\n<p>\u0418, \u043d\u0430\u043a\u043e\u043d\u0435\u0446, \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435, \u043e \u0447\u0451\u043c \u0445\u043e\u0442\u0435\u043b\u043e\u0441\u044c \u0431\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u0442\u044c, \u044d\u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u041d\u0443 \u0442\u0443\u0442 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u043d\u0435\u0439\u0440\u043e\u043d\u043e\u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0441\u043b\u043e\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432, \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u043c \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430:<\/p>\n<p>  <\/p>\n<pre><code class=\"cpp\"> void NeuralNet::getResult(uint16_t size, double* data) { \tfor (uint16_t r = 0; r &lt; size; r++) { \t\tdata[r] = neurons[r][1][numLayers - 1]; \t} } <\/code><\/pre>\n<p>  <\/p>\n<h3>\u0423\u0445\u043e\u0434 \u0432 \u0437\u0430\u043a\u0430\u0442<\/h3>\n<p>  <\/p>\n<p>\u041d\u0430 \u044d\u0442\u043e\u043c \u043c\u044b \u043f\u0440\u0438\u043e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f, \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0441\u0432\u044f\u0449\u0435\u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0435\u0439 \u043e\u0431\u0443\u0447\u0438\u0442\u044c \u0441\u0435\u0442\u044c. \u0418\u0437-\u0437\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u0431\u0438\u043b\u0438\u044f \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0438 \u044f \u0440\u0435\u0448\u0438\u043b \u0432\u044b\u043d\u0435\u0441\u0442\u0438 \u0435\u0451 \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u0442\u0430\u043c \u0436\u0435 \u043c\u044b \u0438 \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c \u0440\u0430\u0431\u043e\u0442\u0443 \u0432\u0441\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u0446\u0435\u043b\u043e\u043c.<\/p>\n<p>  <\/p>\n<p>\u041e\u043f\u044f\u0442\u044c \u0436\u0435, \u0436\u0434\u0443 \u0432\u0430\u0448\u0438 \u0441\u043e\u0432\u0435\u0442\u044b \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0445.<\/p>\n<p>  <\/p>\n<p>\u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0443\u0434\u0435\u043b\u0451\u043d\u043d\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043a \u0441\u0442\u0430\u0442\u044c\u0435, \u0434\u043e \u0441\u043a\u043e\u0440\u043e\u0433\u043e!<\/p>\n<p>  <\/p>\n<p>P.S.: \u041a\u0430\u043a \u0438 \u043e\u0431\u0435\u0449\u0430\u043b \u2014 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0438\u0441\u0445\u043e\u0434\u043d\u0438\u043a\u0438: <a href=\"https:\/\/github.com\/HeavyPunk\/Perceptron_c-\">GitHub<\/a><\/p>\n<\/p><\/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\/514372\/\"> https:\/\/habr.com\/ru\/post\/514372\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/514372\/\">\n<p><h1>\u0418\u0437\u043e\u0431\u0440\u0435\u0442\u0430\u0435\u043c \u0432\u0435\u043b\u043e\u0441\u0438\u043f\u0435\u0434 \u0438\u043b\u0438 \u043f\u0438\u0448\u0435\u043c \u043f\u0435\u0440\u0441\u0435\u043f\u0442\u0440\u043e\u043d \u043d\u0430 C++. \u0427\u0430\u0441\u0442\u044c 1<\/h1>\n<\/p>\n<p>  <\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0435\u0440\u0441\u0435\u043f\u0442\u0440\u043e\u043d\u0430 \u043d\u0430 C++<\/p>\n<p>  <img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/w4\/dl\/fi\/w4dlfihcpjmca4imvsp80fw5i3i.png\" height=\"200\" width=\"320\"\/>  <\/p>\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-308193","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308193","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=308193"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/308193\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=308193"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=308193"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=308193"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}