{"id":321811,"date":"2021-04-21T15:00:10","date_gmt":"2021-04-21T15:00:10","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=321811"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2021-04-21T15:00:10","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=321811","title":{"rendered":"\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043b\u044e\u0431\u044b\u0445 \u0442\u0438\u043f\u043e\u0432 \u043d\u0430 C11 \u0438 \u0432\u044b\u0448\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e _Generic \u0438 variadic \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432"},"content":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/186\/ac6\/4fb\/186ac64fb50cb4e771f1c62afabb4f1a.png\" alt=\"\u0424\u0443\u043d\u043a\u0446\u0438\u044f print \u043d\u0430 \u0421\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u043b\u044e\u0431\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u043b\u044e\u0431\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\" title=\"\u0424\u0443\u043d\u043a\u0446\u0438\u044f print \u043d\u0430 \u0421\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u043b\u044e\u0431\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u043b\u044e\u0431\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435\" width=\"795\" height=\"414\"><figcaption>\u0424\u0443\u043d\u043a\u0446\u0438\u044f print \u043d\u0430 \u0421\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u043b\u044e\u0431\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u043b\u044e\u0431\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435<\/figcaption><\/figure>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f print \u043d\u0430 \u0421\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u043b\u044e\u0431\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u043b\u044e\u0431\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435<\/p>\n<p><a class=\"anchor\" name=\"%D0%9E%20%D1%81%D0%B5%D0%B1%D0%B5\" id=\"\u041e \u0441\u0435\u0431\u0435\"><\/a><\/p>\n<h3>\u041e \u0441\u0435\u0431\u0435<\/h3>\n<p>\u042f \u0441\u0430\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043d\u0430 C++, \u0432\u0435\u0440\u043d\u0435\u0435 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0439, \u0431\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0441\u044f \u0441 \u044f\u0437\u044b\u043a\u043e\u043c \u0421\u0438, \u0430 C++ \u043e\u0442\u043a\u0440\u044b\u043b \u043a\u0430\u043a \u043c\u043e\u0449\u043d\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u0430 C. \u0412 \u043d\u0435\u043c \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434  \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0432\u0435\u0449\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 C (\u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043b\u0430\u0441\u0441\u044b, \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d \u0438 \u0434\u0440), \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u044d\u0442\u0438 \u0432\u0435\u0449\u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0442 \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044e \u044f\u0437\u044b\u043a\u0430<\/p>\n<p><a class=\"anchor\" name=\"%D0%97%D0%B0%D0%B4%D1%83%D0%BC%D0%BA%D0%B0\" id=\"\u0417\u0430\u0434\u0443\u043c\u043a\u0430\"><\/a><\/p>\n<h3>\u0417\u0430\u0434\u0443\u043c\u043a\u0430<\/h3>\n<p>\u042f \u0443\u0437\u043d\u0430\u043b \u0447\u0442\u043e \u0432 C \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 2011 \u0433\u043e\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c &#171;\u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438&#187; \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u0430. (<a href=\"https:\/\/en.cppreference.com\/w\/c\/language\/generic\" rel=\"noopener noreferrer nofollow\">Generic selection<\/a>) \u041c\u043d\u0435, \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u0442\u0430\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430 \u0431\u044b \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/p>\n<p>\u0417\u0430\u0434\u0443\u043c\u043a\u0430: \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c (\u043c\u0430\u043a\u0440\u043e) \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>print<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b. \u0417\u0432\u0443\u0447\u0438\u0442 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0434\u043b\u044f \u0421\u0438, \u0433\u0434\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0442\u0438\u043f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043e\u0434\u043d\u043e\u0439 \u0431\u0443\u043a\u0432\u043e\u0439 \u0432 \u0438\u043c\u0435\u043d\u0438, \u0438 \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0447\u0438\u0441\u043b\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u043e \u0441 \u0434\u0436\u0435\u0439\u043d\u0435\u0440\u0438\u043a\u0430\u043c\u0438 \u0438\u0437 C11 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/p>\n<p><a class=\"anchor\"><\/a><\/p>\n<h3>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043e\u0434\u043d\u0438\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c<\/h3>\n<p>\u0412\u0432\u0438\u0434\u0443 \u0432 \u0441\u0443\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e \u0442\u0438\u043f\u0443 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 \u043e\u0434\u043d\u0438\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c<\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>print(x) <\/code>\u0434\u043b\u044f \u0442\u0438\u043f\u043e\u0432 <code>int, float<\/code> \u0438 <code>char* <\/code>(cstring):<\/p>\n<pre><code>void print_int(int x) {printf(\"%d \", x); }  void print_float(float x) {printf(\"%.4f \", x); } void print_string(char* x) {printf(\"%s \", x); }<\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043c \u0438\u0437 \u043f\u043e\u0434 \u043e\u0434\u043d\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c <code>print<\/code>:<\/p>\n<pre><code>#define print(x) _Generic((X),    int: print_int,    float: print_float,    char*: print_string)(x)<\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c, \u0447\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c <code>print(\"hi\") <\/code>\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>print_string(\"hi\")<\/code>, <code>print(5.5) <\/code>\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>print_float(5.5) <\/code>\u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0438\u0441\u044c <code>print(\"hi\")  <\/code>\u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 <code>_Generic((\"hi\"), int: print_int, float: print_float, char*: print_string)(\"hi\"), <\/code>\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u0431\u0435\u0440\u0435\u0442 \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <code>_Generic(...)<\/code><\/p>\n<p><a class=\"anchor\" name=\"%D0%9D%D0%B5%D0%BE%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%BD%D0%BE%D0%B5%20%D1%87%D0%B8%D1%81%D0%BB%D0%BE%20%D0%BE%D0%B4%D0%BD%D0%BE%D1%80%D0%BE%D0%B4%D0%BD%D1%8B%D1%85%20%D0%B0%D1%80%D0%B3%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%BE%D0%B2\" id=\"\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432\"><\/a><\/p>\n<h3>\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h3>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0435\u0437 \u044f\u0432\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0438\u0445 \u0447\u0438\u0441\u043b\u0430. \u041f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>print_int<\/code><\/p>\n<pre><code>void print_int(int n, ...) {   va_list argptr;   va_start(argptr, n);   int x;   for (int i = 0; i &lt; n; i++)   {     x = va_arg(argptr, int);     printf(\"%d \", x);   }   va_end(argptr); }<\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043b\u044e\u0431\u0435\u0437\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u043b \u0438\u0437 \u0433\u0443\u0433\u043b\u0430 \ud83d\ude42 \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 <code>n<\/code>, \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c<\/p>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>\u041c\u0430\u043a\u0440\u043e\u0441 PP_NARG(&#8230;), \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/p>\n<pre><code>#ifndef PP_NARG \/*       The PP_NARG macro returns the number of arguments that have been    passed to it.     https:\/\/groups.google.com\/g\/comp.std.c\/c\/d-6Mj5Lko_s  \/  #define PP_NARG(...)     PP_NARG_(VA_ARGS,PP_RSEQ_N()) #define PP_NARG_(...)     PP_ARG_N(VA_ARGS) #define PP_ARG_N( _1, _2, _3, _4, _5, _6, _7, _8, _9,_10, _11,_12,_13,_14,_15,_16,_17,_18,_19,_20, _21,_22,_23,_24,_25,_26,_27,_28,_29,_30, _31,_32,_33,_34,_35,_36,_37,_38,_39,_40, _41,_42,_43,_44,_45,_46,_47,_48,_49,_50, _51,_52,_53,_54,_55,_56,_57,_58,_59,_60, _61,_62,_63, N, ...) N #define PP_RSEQ_N() 63,62,61,60, 59,58,57,56,55,54,53,52,51,50, 49,48,47,46,45,44,43,42,41,40, 39,38,37,36,35,34,33,32,31,30, 29,28,27,26,25,24,23,22,21,20, 19,18,17,16,15,14,13,12,11,10, 9,8,7,6,5,4,3,2,1,0 #endif<\/code><\/pre>\n<\/div>\n<\/details>\n<pre><code>#define print(...)    print_int(PP_NARG(VA_ARGS), VA_ARGS)<\/code><\/pre>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: <\/em><code>VA_ARGS <\/code><em>\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043f\u0430\u043b\u0438 \u0432 <\/em><code>...<\/code><\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0434\u0436\u0435\u0439\u043d\u0435\u0440\u0438\u043a\u043e\u0432, \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c<\/p>\n<pre><code>#define function(x, ...) Generic((x),    int: function_int,  float: function_float,  char*: function_string)(PP_NARG(VA_ARGS) + 1, x, VA_ARGS)<\/code><\/pre>\n<p><em>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <\/em><code>function<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b <code>function<\/code>, \u0430 \u043d\u0435 <code>print<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u0442\u043e \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0442\u0438\u043f\u0430, \u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u043a\u043e\u0433\u0434\u0430 \u043b\u044e\u0431\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430<\/p>\n<p><a class=\"anchor\" name=\"%D0%9D%D0%B5%D0%BE%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%BD%D0%BE%D0%B5%20%D1%87%D0%B8%D1%81%D0%BB%D0%BE%20%D0%B0%D1%80%D0%B3%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%BE%D0%B2%20%D0%BB%D1%8E%D0%B1%D0%BE%D0%B3%D0%BE%20%D1%82%D0%B8%D0%BF%D0%B0\" id=\"\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430\"><\/a><\/p>\n<h3>\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430<\/h3>\n<p><a class=\"anchor\" name=\"I.%20%D0%A5%D1%80%D0%B0%D0%BD%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%B8%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%86%D0%B8%D0%B8%20%D0%BE%20%D1%82%D0%B8%D0%BF%D0%B0%D1%85\" id=\"I. \u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u0438\u043f\u0430\u0445\"><\/a><\/p>\n<h3>I. \u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u0438\u043f\u0430\u0445<\/h3>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u0438\u0434\u0430 (\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0432\u043e\u043b\u044c\u043d\u044b\u0439) <code>hidden_print(sep, n, x1, x2, x3, ...), <\/code>\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439  \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>xi <\/code>\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 printf. \u0414\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0443\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c<\/p>\n<p>\u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 12. \u0414\u043b\u044f <code>print<\/code>&#8216;\u0430 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. <\/p>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0422\u0430\u043a \u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u043d\u044e \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439<\/em><\/p>\n<p><em>\u0412\u0441\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0438 <\/em><code>cool<\/code>. \u042d\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d, \u043f\u0440\u043e\u0441\u0442\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043d\u0435\u0441\u0435\u0440\u044c\u0435\u0437\u043d\u0443\u044e, \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435, \u043d\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0448\u0442\u0443\u0447\u043a\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043d\u0430 c++ \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u044c\u044f\u0432\u043b\u0435\u043d\u044b \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d <code>cool<\/code>, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u0421\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d \u043d\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c <code>#define print cool_print<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c <code>#undef print<\/code><\/p>\n<\/div>\n<\/details>\n<p>\u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u0438\u043f\u0430\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 <code>cool_hidden_types[12]<\/code>, \u0438\u043d\u0434\u0435\u043a\u0441 <code>cool_hidden_last<\/code>, \u043a\u0443\u0434\u0430 \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>cool_hidden_add_int<\/code>, <code>cool_hidden_add_float <\/code>\u0438 \u0442.\u0434. \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e \u0442\u0438\u043f\u0430\u0445. \u0412\u0441\u0435\u0433\u043e \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c 7 \u0442\u0438\u043f\u043e\u0432: <code>int, char*, float, double, char (?), uint, long<\/code><\/p>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>char (?)<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 <code>_Generic(('a'), char: fun_char)()<\/code> \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <em>&#171;\u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f <\/em><code>int<\/code><em>&#171;<\/em>, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u0445 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0438 \u043e\u043d \u0434\u0430\u0439 \u0431\u043e\u0433 \u0432\u044b\u0432\u0435\u0434\u0435\u0442\u0441\u044f \u043a\u0430\u043a <code>int<\/code><\/p>\n<\/div>\n<\/details>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e \u0442\u0438\u043f\u0430\u0445 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>#define<\/code>, \u0445\u043e\u0442\u044f \u0432 \u0441\u0438 \u0435\u0441\u0442\u044c \u0438 <code>enum<\/code>. \u041d\u043e \u0440\u0430\u0437 \u0443\u0436 \u0442\u0443\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043d\u0430 \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u0445, \u0442\u043e \u0433\u0443\u043b\u044f\u0442\u044c \u0442\u0430\u043a \u0433\u0443\u043b\u044f\u0442\u044c!<\/p>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>\u041a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0442\u0438\u043f\u043e\u0432<\/p>\n<pre><code>#define COOL_HIDDEN_INT 0 #define COOL_HIDDEN_STRING 1 #define COOL_HIDDEN_FLOAT 2 #define COOL_HIDDEN_DOUBLE 3 #define COOL_HIDDEN_CHAR 4 #define COOL_HIDDEN_UINT 5 #define COOL_HIDDEN_LONG 6 #define COOL_HIDDEN_VOID 7 int cool_hidden_types[12]; int cool_hidden_last = 0; void cool_hidden_add_int() {     cool_hidden_types[cool_hidden_last] = COOL_HIDDEN_INT;     cool_hidden_last += 1; } void cool_hidden_add_string() {     cool_hidden_types[cool_hidden_last] = COOL_HIDDEN_STRING;     cool_hidden_last += 1; } \/*\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 *\/ void cool_hidden_add_void() {     cool_hidden_types[cool_hidden_last] = COOL_HIDDEN_VOID;     cool_hidden_last += 1; }<\/code><\/pre>\n<\/div>\n<\/details>\n<p><code>COOL_HIDDEN_VOID <\/code>\u0431\u0443\u0434\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0432 16-\u0440\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043d\u043e \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0435\u043f\u0435\u0440\u044c generic \u043c\u0430\u043a\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>cool_hidden_add(x)<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430<code> x<\/code><\/p>\n<pre><code>#define cool_hidden_add(x)              Generic((x),           int: cool_hidden_add_int,           char*: cool_hidden_add_string,     float: cool_hidden_add_float,     double: cool_hidden_add_double,     char: cool_hidden_add_char,     unsigned int: cool_hidden_add_uint,     long: cool_hidden_add_long,     default: cool_hidden_add_void )()<\/code><\/pre>\n<p><em>\u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435&#8230;<\/em><\/p>\n<p><a class=\"anchor\" name=\"II.%20%D0%9E%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%20%D1%87%D0%B8%D1%81%D0%BB%D0%B0%20%D0%B0%D1%80%D0%B3%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%BE%D0%B2%20%D0%BD%D0%B0%20%D1%83%D1%80%D0%BE%D0%B2%D0%BD%D0%B5%20%D0%BC%D0%B0%D0%BA%D1%80%D0%BE%D1%81%D0%B0\" id=\"II. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u0430\"><\/a><\/p>\n<h3>II. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u0430<\/h3>\n<p><em>\u0418\u0434\u0435\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 \u0432\u0438\u0434\u0430 <\/em><code>cool_print##n(x1, x2, ..., xn)<\/code> <em>(&#171;##&#187; \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0430\u0446\u0438\u044e \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <\/em><code>n<\/code><em>)<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0438\u043f\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e <code>xi<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>cool_hidden_print(sep, n, x1, x2, ...)<\/code> \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c, <code>n<\/code>, \u0438 \u0432\u0441\u0435 <code>xi<\/code>. \u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044e \u043a\u0430\u043a \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e (\u0435\u0441\u043b\u0438 \u0442\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u043e\u0439) \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>cool_print_sep = \" \"<\/code>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442<\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0425\u043e\u0442\u044f \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u043c\u0438, \u043d\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u0443\u0436\u0435 \u043b\u0435\u043d\u044c. (\u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0443 \u043c\u0435\u043d\u044f \u0438 \u0442\u0430\u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440  visual studio \u0437\u0430\u0431\u043b\u0443\u0434\u0438\u043b\u0441\u044f \u0432 \u043a\u0443\u0447\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0442\u0430\u043c, \u0433\u0434\u0435 \u0432\u0441\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435)<\/p>\n<pre><code>\u0412 \u043e\u0431\u0449\u0435\u043c \u0432\u0438\u0434\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a: #define cool_print_n(x1, x2, x3, x4, ..., xn, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     ...................     cool_hidden_add(xn);     cool_hidden_print(cool_print_sep, 6, x1, x2, x3, x4, ..., xn) <\/code><\/pre>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434<\/p>\n<pre><code> #if 1 or \"hide this a big part of code\" #define cool_print_12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_add(x5);     cool_hidden_add(x6);     cool_hidden_add(x7);     cool_hidden_add(x8);     cool_hidden_add(x9);     cool_hidden_add(x10);     cool_hidden_add(x11);     cool_hidden_add(x12);     cool_hidden_print(cool_print_sep, 12, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) #define cool_print_11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_add(x5);     cool_hidden_add(x6);     cool_hidden_add(x7);     cool_hidden_add(x8);     cool_hidden_add(x9);     cool_hidden_add(x10);     cool_hidden_add(x11);     cool_hidden_print(cool_print_sep, 11, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) #define cool_print_10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_add(x5);     cool_hidden_add(x6);     cool_hidden_add(x7);     cool_hidden_add(x8);     cool_hidden_add(x9);     cool_hidden_add(x10);     cool_hidden_print(cool_print_sep, 10, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) #define cool_print_9(x1, x2, x3, x4, x5, x6, x7, x8, x9, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_add(x5);     cool_hidden_add(x6);     cool_hidden_add(x7);     cool_hidden_add(x8);     cool_hidden_add(x9);     cool_hidden_print(cool_print_sep, 9, x1, x2, x3, x4, x5, x6, x7, x8, x9) #define cool_print_8(x1, x2, x3, x4, x5, x6, x7, x8, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_add(x5);     cool_hidden_add(x6);     cool_hidden_add(x7);     cool_hidden_add(x8);     cool_hidden_print(cool_print_sep, 8, x1, x2, x3, x4, x5, x6, x7, x8) #define cool_print_7(x1, x2, x3, x4, x5, x6, x7, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_add(x5);     cool_hidden_add(x6);     cool_hidden_add(x7);     cool_hidden_print(cool_print_sep, 7, x1, x2, x3, x4, x5, x6, x7) #define cool_print_6(x1, x2, x3, x4, x5, x6, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_add(x5);     cool_hidden_add(x6);     cool_hidden_print(cool_print_sep, 6, x1, x2, x3, x4, x5, x6) #define cool_print_5(x1, x2, x3, x4, x5, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_add(x5);     cool_hidden_print(cool_print_sep, 5, x1, x2, x3, x4, x5) #define cool_print_4(x1, x2, x3, x4, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_print(cool_print_sep, 4, x1, x2, x3, x4) #define cool_print_3(x1, x2, x3, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_print(cool_print_sep, 3, x1, x2, x3) #define cool_print_2(x1, x2, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_print(cool_print_sep, 2, x1, x2) #define cool_print_1(x, ...)       cool_hidden_add(x);     cool_hidden_print(cool_print_sep, 1, x) #endif \/\/\"hide this a big part of code\" <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u043f\u043e\u0439\u043b\u0435\u0440\u0438\u043b, \u0447\u0442\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u043a\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>cool_print_n <\/code>\u0432\u0441\u0435\u0433\u0434\u0430 12, \u0438 \u0447\u0442\u043e \u043f\u043e\u0441\u043b\u0435 \u043d\u0435\u0435 \u0438\u0434\u0435\u0442 <code>...<\/code>, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u0434\u0430\u043b\u0435\u0435<\/p>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0430\u043a\u0440\u043e\u0441\u0430 <code>PP_NARG(VA_ARGS<\/code>) \u043d\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0430\u043f\u0440\u044f\u043c\u0443\u044e \u0432 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 <code>cool_print_##PP_NARG(VA_ARGS)<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043d\u043e \u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0435\u0442\u0441\u044f \u0432 \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <code>cool_print_PP_NARG(\"x\", 5, \"i\", 8,), <\/code>\u0447\u0442\u043e \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0441\u043c\u044b\u0441\u043b\u0430. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0434\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434 \u0438\u0437 \u043c\u0430\u043a\u0440\u043e\u0441\u0430, \u043d\u043e \u043d\u0435 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u0441\u0440\u0430\u0437\u0443 \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c<\/p>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>\u043a\u043e\u0434 PP_NARG(<strong>VA_ARGS<\/strong>) \u0435\u0449\u0435 \u0440\u0430\u0437<\/p>\n<pre><code>#ifndef PP_NARG \/*       The PP_NARG macro returns the number of arguments that have been    passed to it.     https:\/\/groups.google.com\/g\/comp.std.c\/c\/d-6Mj5Lko_s  \/  #define PP_NARG(...)     PP_NARG_(VA_ARGS,PP_RSEQ_N()) #define PP_NARG_(...)     PP_ARG_N(VA_ARGS) #define PP_ARG_N( _1, _2, _3, _4, _5, _6, _7, _8, _9,_10, _11,_12,_13,_14,_15,_16,_17,_18,_19,_20, _21,_22,_23,_24,_25,_26,_27,_28,_29,_30, _31,_32,_33,_34,_35,_36,_37,_38,_39,_40, _41,_42,_43,_44,_45,_46,_47,_48,_49,_50, _51,_52,_53,_54,_55,_56,_57,_58,_59,_60, _61,_62,_63, N, ...) N #define PP_RSEQ_N() 63,62,61,60, 59,58,57,56,55,54,53,52,51,50, 49,48,47,46,45,44,43,42,41,40, 39,38,37,36,35,34,33,32,31,30, 29,28,27,26,25,24,23,22,21,20, 19,18,17,16,15,14,13,12,11,10, 9,8,7,6,5,4,3,2,1,0 #endif<\/code><\/pre>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>cool_print(&#8230;) &#8212; \u0442\u043e\u0442 \u0436\u0435 PP_NARG, \u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u043d\u044b\u0439<\/p>\n<pre><code> #define cool_print(...)     cool_print_(VA_ARGS , COOL_RSEQ_N()) #define cool_print_(...)     COOL_ARG_N(VA_ARGS) #define COOL_ARG_N(     _1, _2, _3, _4, _5, _6, _7, _8, _9,_10, _11,_12,_13,_14,_15,_16,_17,_18,_19,_20,     _21,_22,_23,_24,_25,_26,_27,_28,_29,_30, _31,_32,_33,_34,_35,_36,_37,_38,_39,_40,     _41,_42,_43,_44,_45,_46,_47,_48,_49,_50, _51,_52,_53,_54,_55,_56,_57,_58,_59,_60,     _61,_62,63, n, ...)                             cool_print##n(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11,_12) #define COOL_RSEQ_N()     63,62,61,60,59,58,57,56,55,54,53,52,51,50,     49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,     29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,     9,8,7,6,5,4,3,2,1,0 <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u041a\u0430\u043a \u044d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442:<\/p>\n<pre><code>1. \u0423\u0441\u043b\u043e\u0432\u043d\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432\u044b\u0437\u043e\u0432 cool_print(\"a\", 4, \"b\")  \u042d\u0442\u043e \u043f\u0440\u0435\u0432\u0440\u0430\u0449\u0430\u0435\u0442\u0441\u044f \u0432 cool_print_(\"a\", 4, \"b\", 63,62,61,60,59,58,57,56,55,54,53,52,51,50,  49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,  29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,  9,8,7,6,5,4,3,2,1,0  \u0417\u0430\u0442\u0435\u043c \u0438\u0437 cool_print_ \u044d\u0442\u043e \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u0432 \u043c\u0430\u043a\u0440\u043e\u0441 COOL_ARG_N,   \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043f\u0440\u0438\u043d\u044f\u0442\u044c 64 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430. \u0412 64-\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442, \u043d\u0430\u0437\u0432\u0430\u043d\u043d\u044b\u0439 n \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 VA_ARGS \u043f\u0435\u0440\u0435\u0434 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c\u044e COOL_RSEQ_N  (63..0) \u0447\u0430\u0441\u0442\u044c \u0447\u0438\u0441\u0435\u043b \u0438\u0437 \u044d\u0442\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0442\u0435\u0441\u043d\u044f\u0435\u0442\u0441\u044f  \u0412 \u043a\u043e\u043d\u0446\u0435 \u043a\u043e\u043d\u0446\u043e\u0432 \u0432 \u043c\u0430\u043a\u0440\u043e\u0441\u0435 COOL_ARG_N \u043f\u0440\u043e\u0441\u0438\u0445\u043e\u0434\u0438\u0442 \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0430\u0446\u0438\u044f cool_print_##n   \u0438 \u0432\u044b\u0437\u043e\u0432 \u044d\u0442\u043e\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e cool_print_3 cool_print_3(\"a\", 4, \"b\", 63,62,61,60,59,58,57,56,55,54,53,52,51,50,  49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,  29,28,27,26,25,24,23,22,21,20,19,18,17,16,15,14,13,12,11,10,  9,8,7,6,5,4,3)  \u0412\u0441\u0435\u0433\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f 12 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043e\u0431\u0440\u0435\u0437\u0430\u0442\u044c \u043b\u0438\u0448\u043d\u0438\u0435.    \u0418 \u044d\u0442\u043e \u0438 \u043d\u0435 \u043d\u0430\u0434\u043e, \u0442\u0430\u043a \u043a\u0430\u043a \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \"...\" \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430 cool_print_##n \u043e\u043d\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u043d\u044b \u043f\u0440\u043e\u0433\u043b\u043e\u0442\u0438\u0442\u044c \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0439 \u0445\u0432\u043e\u0441\u0442  \u0422\u0430\u043a \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 64 \u0434\u043e 12,    \u043d\u043e \u044f \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043b \u044d\u0442\u043e \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u044b\u043c <\/code><\/pre>\n<p><a class=\"anchor\" name=\"III.%20%D0%A1%D0%BE%D0%B1%D1%81%D1%82%D0%B2%D0%B5%D0%BD%D0%BD%D0%BE%20%D1%80%D0%B5%D0%B0%D0%BB%D0%B8%D0%B7%D0%B0%D1%86%D0%B8%D1%8F%20%D1%84%D1%83%D0%BD%D0%BA%D1%86%D0%B8%D0%B8\" id=\"III. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438\"><\/a><\/p>\n<h3>III. \u0421\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<p>\u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u0443 \u043d\u0430\u0441 \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 <code>cool_print(\"\u043d\u0430\u0448\u0438\", \"\u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b\", 10) <\/code>\u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <code>cool_hidden_types<\/code> \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0442\u0438\u043f\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>cool_hidden_print(int sep, int n, ...)<\/code>! \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u043f\u0438\u0448\u0435\u043c \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/p>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>\u041d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u043f\u043e\u044f\u0441\u043d\u0435\u043d\u0438\u0435 \u043a\u0430\u043a \u0432 C \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0447\u0438\u0441\u043b\u043e\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043e\u043e\u0431\u0449\u0435<\/p>\n<p>\u0412 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u0432 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u0447\u043d\u043e\u043c \u0444\u0430\u0439\u043b\u0435 <code>&lt;stdarg.h&gt;<\/code> \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u043c\u0430\u043a\u0440\u043e\u0441\u0430, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439. \u0412\u043e\u0442 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439:<\/p>\n<ol>\n<li>\n<p>\u0412 \u043e\u0431\u044c\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u043d\u0430\u0434\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c <code>...<\/code><\/p>\n<\/li>\n<li>\n<p><code>va_list argptr<\/code>&#8212; \u044d\u0442\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f <code>argptr<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c<\/p>\n<\/li>\n<li>\n<p><code>va_start(argptr, n)<\/code>&#8212; \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442<\/p>\n<\/li>\n<li>\n<p><code>va_arg(argptr, float)<\/code>&#8212; \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u0443\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430<\/p>\n<\/li>\n<li>\n<p><code>va_end(argptr)<\/code>&#8212; \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438<\/p>\n<\/li>\n<\/ol>\n<p>\u0418\u0442\u043e\u0433\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0432 \u0421\u0438 \u0431\u0435\u0437 \u0432\u0441\u044f\u043a\u0438\u0445 \u044d\u0442\u0438\u0445 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u043a\u0430\u043a\u0438\u043c\u0438-\u043d\u0438\u0431\u0443\u0434\u044c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0442\u0438\u043f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430, \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u043f\u0440\u0435\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043f\u0435\u0440\u0435\u0431\u043e\u0440\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/p>\n<\/div>\n<\/details>\n<p>\u0421\u0443\u0442\u044c \u0442\u0430\u043a\u043e\u0432\u0430: \u0432 \u0446\u0438\u043a\u043b\u0435 \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432\u0441\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b. \u0412 swich&#8217;e \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a\u0430\u0441\u0442\u0438\u0442\u0441\u044f \u0432 void&#8217;\u044b\u0439 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c x, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0435 <code>printf(\"...%s\", *((type) x), sep)<\/code>, \u0433\u0434\u0435 <code>type <\/code>&#8212; \u044d\u0442\u043e \u0442\u0438\u043f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430, \u0430 &#171;&#8230;&#187; &#8212; \u044d\u0442\u043e \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0439 \u0434\u043b\u044f \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 \u0444\u043e\u0440\u043c\u0430\u0442 \u0432\u044b\u0432\u043e\u0434\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f <code>int <\/code>\u044d\u0442\u043e <code>printf(\"%d%s\", *((type) x), sep)<\/code>. \u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u043d\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0438 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0442\u0438\u043f\u043e\u0432 \u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u043c\u0430\u043a\u0440\u043e\u0441 <code>#define COOL_CAST(T, x) ((T) (x))<\/code><\/p>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>\u043a\u043e\u0434 cool_hidden_print(sep, n, &#8230;)<\/p>\n<pre><code>#define COOL_CAST(T, x) ((T) (x))   void cool_hidden_print(char* sep, int n, ...) {     va_list argptr;     va_start(argptr, n); void* x;  for (int i = 0; i &amp;lt; n; i++) {     switch (cool_hidden_types[i])     {     case COOL_HIDDEN_INT:         x = &amp;amp;va_arg(argptr, int);         printf(\"%d%s\", COOL_CAST(int, x), sep);         break;      case COOL_HIDDEN_STRING:         x = &amp;amp;va_arg(argptr, char*);         printf(\"%s%s\", COOL_CAST(char*, x) , sep);         break;      case COOL_HIDDEN_FLOAT:         x = &amp;amp;va_arg(argptr, float);         printf(\"%.4f%s\", COOL_CAST(float, x), sep);         break;      case COOL_HIDDEN_DOUBLE:         x = &amp;amp;va_arg(argptr, double);         printf(\"%.4f%s\", COOL_CAST(double, x), sep);         break;      case COOL_HIDDEN_CHAR:         x = &amp;amp;va_arg(argptr, char);         printf(\"%c%s\", COOL_CAST(char, x), sep);         break;      case COOL_HIDDEN_UINT:         x = &amp;amp;va_arg(argptr, unsigned int);         printf(\"%.4u%s\", COOL_CAST(unsigned int, x), sep);         break;      case COOL_HIDDEN_VOID:         printf(\"unsupported type%s\", sep);         break;      default:         printf(\"Internal COOL\/CPRINT error line: %d in %s\", __LINE__, __FILE__);         break;     }  }  va_end(argptr); cool_hidden_last = 0;  }<\/code><\/pre>\n<\/div>\n<\/details>\n<p><a class=\"anchor\" name=\"%D0%94%D0%BE%D0%BF%D0%BE%D0%BB%D0%BD%D0%B8%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5%20%D0%BC%D0%B5%D0%BB%D0%BE%D1%87%D0%B8\" id=\"\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u043b\u043e\u0447\u0438\"><\/a><\/p>\n<h3>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u043b\u043e\u0447\u0438<\/h3>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u043e\u0442 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0438 <code>cool_ <\/code>\u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<\/p>\n<p><code>#define print cool_print<\/code><\/p>\n<p>\u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f <code>print <\/code>\u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442! \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0432\u0438\u0448\u0435\u043d\u043a\u0438 \u043d\u0430 \u0442\u043e\u0440\u0442\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>println<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0441\u043b\u0435 \u0432\u044b\u0432\u043e\u0434\u0430 \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442 \u043d\u0430\u0441 \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u0441\u0442\u0440\u043e\u043a\u0443<\/p>\n<pre><code>#define cool_println(...)     cool_print(VA_ARGS);    printf(\"\\n\") #define cool_printlnn() printf(\"\\n\")<\/code><\/pre>\n<p>\u041a \u043c\u043e\u0435\u043c\u0443 \u0431\u043e\u043b\u044c\u0448\u043e\u043c\u0443 \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u044f \u043d\u0435 \u0441\u043c\u043e\u0433 \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0447\u0442\u043e \u043f\u0440\u0438 \u0432\u044b\u0437\u043e\u0432\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0430 \u0438\u0437-\u0437\u0430 \u043b\u0438\u0448\u043d\u0435\u0439 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c <code>printlnn()<\/code>&#8230; \u042f \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u0440\u0435\u0448\u0438\u0442\u044c \u044d\u0442\u043e, \u043f\u0440\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0438 <code>cool_print<\/code><\/p>\n<pre><code>\u043d\u0438 \u0442\u0430\u043a #define cool_print(...)     cool_print_(VA_ARGS , ## COOL_RSEQ_N() \u043d\u0438 \u0442\u0430\u043a #define cool_print(...)     cool_print_(VA_ARGS ## , COOL_RSEQ_N() \u0432\u0441\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442<\/code><\/pre>\n<p>\u041a\u0430\u043a \u0441\u043e\u0432\u0435\u0442\u0443\u044e\u0442 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442. \u0412\u0438\u0434\u0438\u043c\u043e \u044d\u0442\u0430 \u0437\u0430\u043f\u0438\u0441\u044c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f <code>,## VA_ARGS<\/code>, \u043a\u043e\u0433\u0434\u0430 <code>VA_ARGS <\/code>\u0438\u0434\u0435\u0442 \u0432 \u043a\u043e\u043d\u0446\u0435, \u0430 \u043d\u0435 \u0432 \u043d\u0430\u0447\u0430\u043b\u0435<\/p>\n<p>\u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u043c\u043e\u0436\u043d\u043e \u043a\u0430\u043a-\u043d\u0438\u0431\u0443\u0434\u044c \u0435\u0449\u0435 \u043e\u0434\u043d\u0438\u043c \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u044b\u043c \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 <code>VA_ARGS <\/code>\u043f\u0443\u0441\u0442\u044b\u043c. \u042f \u043d\u0430\u0448\u0435\u043b \u0432 \u0433\u0443\u0433\u043b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u043e\u0433\u0434\u0430 \u043a\u043e\u0433\u0434\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c 2 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430<\/p>\n<p>\u0415\u0449\u0435 \u0435\u0441\u0442\u044c \u0435\u0449\u0435 \u043d\u0435\u043a\u0438\u0439 <code>VAR_OPT<\/code>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u0435\u043b\u0430\u0435\u0442 \u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u043e, \u043d\u043e \u0435\u0433\u043e \u0434\u043e\u0431\u0430\u0432\u044f\u0442, \u043a\u0430\u043a \u044f \u043f\u043e\u043d\u044f\u043b, \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0435<\/p>\n<p>\u0423 \u043c\u0435\u043d\u044f \u043f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u0441\u0440\u0430\u0431\u043e\u0442\u0430\u043b\u043e \u043e\u0434\u0438\u043d \u0440\u0430\u0437 <code>(,)<\/code>, \u043d\u043e \u043f\u043e\u0441\u043b\u0435 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a\u0430 visual stidio \u0441\u0442\u0430\u043b\u043e<code> VAR_OPT <\/code>\u043d\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043e. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0432 \u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 <code>VAR_OPT<\/code> \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435\u043b\u044c\u0437\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u0430\u043a\u0440\u043e\u0441 \u0431\u0443\u0434\u0435\u0442 \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0442\u043e \u0443 \u043d\u0430\u0441 63 \u0430 \u043d\u0435 64 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 (\u0447\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u0430 \u043a \u043e\u0448\u0438\u0431\u043a\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u043d\u0435 \u0442\u043e\u0433\u043e <code>cool_print##n <\/code>(\u043d\u0430 \u0435\u0434\u0438\u043d\u0438\u0446\u0443 \u043c\u0435\u043d\u044c\u0448\u0435). \u041d\u0443\u0436\u043d\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435<\/p>\n<pre><code>#define cool_print(...)     VAR_OPT(  cool_print_(VA_ARGS , COOL_RSEQ_N())  ) \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e #define cool_print(...)        cool_print_(VA_ARGS , COOL_RSEQ_N())<\/code><\/pre>\n<hr>\n<p><a class=\"anchor\" name=\"%D0%9F%D1%80%D0%BE%D0%B1%D0%BB%D0%B5%D0%BC%D1%8B%20%D1%8D%D1%82%D0%BE%D0%B3%D0%BE%20%D0%BC%D0%B5%D1%82%D0%BE%D0%B4%D0%B0\" id=\"\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430\"><\/a><\/p>\n<h3>\u041f\u0440\u043e\u0431\u043b\u0435\u043c\u044b \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430<\/h3>\n<ul>\n<li>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 &#8212; \u044d\u0442\u043e \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0436\u0435 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0431\u0435\u0437 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u043e\u0433\u0440\u043e\u043c\u043d\u044b\u043c \u043c\u0438\u043d\u0443\u0441\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0442\u043e, \u0447\u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0448\u0438\u0431\u043a\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043d\u0435\u0432\u043d\u044f\u0442\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0435, \u0438 \u044f \u043d\u0435 \u0432\u0438\u0436\u0443 \u043a\u0443\u0434\u0430 \u043c\u043e\u0436\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0435\u0433\u043e<\/p>\n<\/li>\n<li>\n<p>\u0412\u0442\u043e\u0440\u043e\u0435 &#8212; \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u0430 C++ \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435. \u0425\u043e\u0442\u044f, \u0438\u043c\u0435\u044f \u0432 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u043c\u043e\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>print <\/code>\u0431\u0443\u0434\u0435\u0442 \u043d\u0435 \u0442\u0430\u043a \u0441\u043b\u043e\u0436\u043d\u043e \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043b\u044e\u0431\u0443\u044e \u0434\u0440\u0443\u0433\u0443\u044e<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0442\u044c\u0435 &#8212; \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440. \u0412 visual studio \u0443 \u043c\u0435\u043d\u044f \u043f\u043e\u0434\u0447\u0435\u0440\u043a\u043d\u0443\u0442 \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u043a\u0430\u0436\u0434\u044b\u0439 <code>print <\/code>\u0438 <code>println <\/code>\u0441\u043e \u0441\u043b\u043e\u0432\u0430\u043c\u0438 <em>&#171;\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435&#187;<\/em>, \u0438 \u0432\u0438\u0441\u0438\u0442 \u043f\u043e \u043e\u0434\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u0438 (\u043f\u0440\u044f\u043c \u043a\u0440\u0430\u0441\u043d\u044b\u043c \u0446\u0432\u0435\u0442\u043e\u043c) \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u044d\u0442\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438. \u041d\u0435 \u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u044d\u0442\u043e \u0432\u0441\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f. \u0418 \u0434\u0430\u0436\u0435 \u043d\u0435 \u0434\u0443\u043c\u0430\u044e \u0447\u0442\u043e \u043d\u0430 \u044d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0442\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u0441\u0438\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0447\u0435\u043c \u043d\u0430 \u0440\u0430\u0441\u043a\u0440\u044b\u0442\u0438\u0435 variadic templates \u0432 c++, \u0445\u043e\u0442\u044f \u044f \u0442\u0435\u0441\u0442\u044b \u043d\u0435 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b (\u0430 \u043a\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438 &#8212; \u044d\u0442\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u0432\u043e\u043f\u0440\u043e\u0441)<\/p>\n<p>\u042d\u0442\u043e\u0442 \u043c\u0438\u043d\u0443\u0441 \u0441\u0430\u043c\u044b\u0439 \u043f\u043e\u0436\u0430\u043b\u0443\u0439 \u043a\u0440\u0438\u0442\u0438\u0447\u043d\u044b\u0439. \u0415\u0441\u043b\u0438 \u0437\u043d\u0430\u0435\u0442\u0435 \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0434\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0438 \u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u0448\u0438\u0431\u043a\u0438, \u0442\u043e \u043f\u043e\u0434\u0441\u043a\u0430\u0436\u0438\u0442\u0435 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445<\/p>\n<\/li>\n<\/ul>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/869\/2af\/97d\/8692af97dd7067453cb855b69b7f50cd.png\" alt=\"\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e\" title=\"\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e\" width=\"713\" height=\"471\"><figcaption>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e<\/figcaption><\/figure>\n<p>\u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u043a\u0440\u0430\u0441\u043d\u043e<\/p>\n<hr>\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u0430\u043d\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043a\u0438 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0439\u0442\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u043d\u0430 \u043c\u043e\u0435\u043c \u0433\u0438\u0442\u0445\u0430\u0431\u0435: <a href=\"https:\/\/github.com\/light-and-ray\/cool\/blob\/master\/cool\/c\/print.h\" rel=\"noopener noreferrer nofollow\">print.h<\/a><\/p>\n<p>\u0410 \u0432\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/github.com\/light-and-ray\/cool\/blob\/master\/c_example.c\" rel=\"noopener noreferrer nofollow\">c_example.c<\/a><\/p>\n<p><a class=\"anchor\" name=\"%D0%97%D0%B0%D0%BA%D0%BB%D1%8E%D1%87%D0%B5%D0%BD%D0%B8%D0%B5\" id=\"\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\"><\/a><\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0423\u0434\u0438\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0441\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0430 \u0447\u0438\u0441\u0442\u043e\u043c \u0421\u0438 \u0441 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u0430\u0431\u044b\u043c\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430\u043c\u0438. \u041d\u043e \u0432\u0441\u0435 \u0436\u0435 \u0421\u0438 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u043d\u0435 \u0441\u043e\u0432\u0441\u0435\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e. \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0443\u0436\u043d\u0430 \u0432 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0430, \u0445\u043e\u0442\u044f \u043c\u043e\u0436\u0435\u0442 \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c \u0438 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435. \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u0434\u0430 \u043d\u0430 \u0421\u0438 \u043a\u0430\u043a \u0440\u0430\u0437 \u0438 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d C++, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441 \u043e\u0431\u044c\u0435\u043a\u0442\u0430\u043c\u0438 \u0447\u0435\u0440\u0435\u0437 \u043a\u043b\u0430\u0441\u0441, \u0430 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c id \u043e\u0431\u044c\u0435\u043a\u0442\u0430 \u043f\u0435\u0440\u0432\u044b\u043c \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u043c \u0432 \u043c\u0435\u0442\u043e\u0434\u0430\u0445; \u043e\u043d \u043f\u043e\u0437\u0432\u0430\u043b\u044f\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \u0442\u0435\u0445 \u0441\u043b\u0443\u0447\u0430\u0435\u0432, \u043a\u043e\u0433\u0434\u0430 \u044d\u0442\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e (\u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0442\u0438\u043f\u0430 <code>pow, powi, powf<\/code>); \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044f \u0441\u0441\u044b\u043b\u043a\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0433\u043e\u0440\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043e\u043a, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b. \u041d\u043e \u043a\u0430\u043a \u0438\u0442\u043e\u0433 \u0432\u0441\u0435\u0433\u043e \u044d\u0442\u043e\u0433\u043e &#8212; \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044f<\/p>\n<p>\u0412\u043e\u0442 \u043f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0439 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>print <\/code>\u043d\u0430 C++:<\/p>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>print \u043d\u0430 C++<\/p>\n<pre><code>#ifndef COOL_PRINT_HPP #define COOL_PRINT_HPP #include &lt;string&gt; #include &lt;iostream&gt; #include &lt;iomanip&gt; namespace {     std::ostream* out = &amp;std::cout; } namespace cool {     inline void setCyrillic()     {         setlocale(LC_ALL, \"Russian\");     } void setPrintOut(std::ostream&amp;amp; os) {     ::out = &amp;amp;os; }  std::ostream* getPrintOutPtr() {     return ::out; }  inline void printFlush() {     *::out &amp;lt;&amp;lt; std::flush; }  inline void print()  {      *::out &amp;lt;&amp;lt; ' '; }  template &amp;lt;typename Arg&amp;gt; inline void print(const Arg&amp;amp; arg) {     *::out &amp;lt;&amp;lt;  std::fixed &amp;lt;&amp;lt; std::setprecision(4) &amp;lt;&amp;lt; arg &amp;lt;&amp;lt; ' '; }  template &amp;lt;typename Arg, typename... Args&amp;gt; void print(const Arg&amp;amp; arg, const Args&amp;amp;... args) {     print(arg);     print(args...); } \/\/\/\/  inline void println() {     *::out &amp;lt;&amp;lt; '\\n'; } template &amp;lt;typename Arg&amp;gt; inline void println(const Arg&amp;amp; arg) {     *::out &amp;lt;&amp;lt; std::fixed &amp;lt;&amp;lt; std::setprecision(4) &amp;lt;&amp;lt; arg &amp;lt;&amp;lt; '\\n'; }  template &amp;lt;typename... Args&amp;gt; void println(const Args&amp;amp;... args) {     print(args...);     println(); } \/\/\/ void print0() { }  template &amp;lt;typename Arg&amp;gt; inline void print0(const Arg&amp;amp; arg) {     *::out &amp;lt;&amp;lt; std::fixed &amp;lt;&amp;lt; std::setprecision(4) &amp;lt;&amp;lt; arg; }  template &amp;lt;typename Arg, typename... Args&amp;gt; void print0(const Arg&amp;amp; arg, const Args&amp;amp;... args) {     print0(arg);     print0(args...); }  } #endif <\/code><\/pre>\n<\/div>\n<\/details>\n<p>\u0411\u043e\u043b\u0435\u0435 \u043f\u043e\u043d\u044f\u0442\u043d\u043e, \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0432 3 \u0440\u0430\u0437\u0430 \u043c\u0435\u043d\u044c\u0448\u0435 \u043a\u043e\u0434\u0430, \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0431\u043e\u043b\u0435\u0435 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u0430\u044f. \u041d\u043e \u0432 \u0442\u043e \u0436\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 <code>printf <\/code>\u0445\u043e\u0442\u044c \u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435 \u0442\u0430\u043a \u0438\u0437\u044f\u0449\u043d\u043e, \u043d\u043e \u0437\u0430\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0438 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u044b\u0439. \u041a\u0430\u0436\u0434\u043e\u043c\u0443 \u044f\u0437\u044b\u043a\u0443 \u0441\u0432\u043e\u0435 \u043c\u0435\u0441\u0442\u043e<\/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\/553636\/\"> https:\/\/habr.com\/ru\/post\/553636\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text_v2\" id=\"post-content-body\">\n<figure class=\"\"><figcaption>\u0424\u0443\u043d\u043a\u0446\u0438\u044f print \u043d\u0430 \u0421\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u043b\u044e\u0431\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u043b\u044e\u0431\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435<\/figcaption><\/figure>\n<p>\u0424\u0443\u043d\u043a\u0446\u0438\u044f print \u043d\u0430 \u0421\u0438, \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u044e\u0449\u0430\u044f \u043b\u044e\u0431\u044b\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u0432 \u043b\u044e\u0431\u043e\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435<\/p>\n<p><a class=\"anchor\" name=\"%D0%9E%20%D1%81%D0%B5%D0%B1%D0%B5\" id=\"\u041e \u0441\u0435\u0431\u0435\">\u0431\u0435&#187;<\/a><\/p>\n<h3>\u041e \u0441\u0435\u0431\u0435<\/h3>\n<p>\u042f \u0441\u0430\u043c \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u043d\u0430 C++, \u0432\u0435\u0440\u043d\u0435\u0435 \u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0439, \u0431\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u0440\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u043e\u043f\u044b\u0442\u0430. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u044f \u043f\u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u043b\u0441\u044f \u0441 \u044f\u0437\u044b\u043a\u043e\u043c \u0421\u0438, \u0430 C++ \u043e\u0442\u043a\u0440\u044b\u043b \u043a\u0430\u043a \u043c\u043e\u0449\u043d\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u044f\u0437\u044b\u043a\u0430 C. \u0412 \u043d\u0435\u043c \u043d\u0430 \u043c\u043e\u0439 \u0432\u0437\u0433\u043b\u044f\u0434  \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0442\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0432\u0435\u0449\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043d\u0435\u0442 \u0432 C (\u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u043a\u043b\u0430\u0441\u0441\u044b, \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d \u0438 \u0434\u0440), \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u044d\u0442\u0438 \u0432\u0435\u0449\u0438 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u044f\u044e\u0442 \u0444\u0438\u043b\u043e\u0441\u043e\u0444\u0438\u044e \u044f\u0437\u044b\u043a\u0430<\/p>\n<p><a class=\"anchor\" name=\"%D0%97%D0%B0%D0%B4%D1%83%D0%BC%D0%BA%D0%B0\" id=\"\u0417\u0430\u0434\u0443\u043c\u043a\u0430\">\u043c\u043a\u0430&#187;<\/a><\/p>\n<h3>\u0417\u0430\u0434\u0443\u043c\u043a\u0430<\/h3>\n<p>\u042f \u0443\u0437\u043d\u0430\u043b \u0447\u0442\u043e \u0432 C \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 2011 \u0433\u043e\u0434\u0430 \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c &#171;\u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438&#187; \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u0430. (<a href=\"https:\/\/en.cppreference.com\/w\/c\/language\/generic\" rel=\"noopener noreferrer nofollow\">Generic selection<\/a>) \u041c\u043d\u0435, \u043e\u0447\u0435\u043d\u044c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u0441\u0442\u0430\u043b\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a\u0443\u044e-\u043d\u0438\u0431\u0443\u0434\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430 \u0431\u044b \u044d\u0442\u0443 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c<\/p>\n<p>\u0417\u0430\u0434\u0443\u043c\u043a\u0430: \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c (\u043c\u0430\u043a\u0440\u043e) \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>print<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0447\u0435\u0440\u0435\u0437 \u043f\u0440\u043e\u0431\u0435\u043b \u0432\u0441\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u043d\u0435\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b. \u0417\u0432\u0443\u0447\u0438\u0442 \u043d\u0435\u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e \u0434\u043b\u044f \u0421\u0438, \u0433\u0434\u0435 \u043e\u0431\u044b\u0447\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0442\u0438\u043f \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043e\u0434\u043d\u043e\u0439 \u0431\u0443\u043a\u0432\u043e\u0439 \u0432 \u0438\u043c\u0435\u043d\u0438, \u0438 \u044f\u0432\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0447\u0438\u0441\u043b\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u043e \u0441 \u0434\u0436\u0435\u0439\u043d\u0435\u0440\u0438\u043a\u0430\u043c\u0438 \u0438\u0437 C11 \u044d\u0442\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e<\/p>\n<p><a class=\"anchor\"><\/a><\/p>\n<h3>\u041f\u0440\u043e\u0441\u0442\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043e\u0434\u043d\u0438\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c<\/h3>\n<p>\u0412\u0432\u0438\u0434\u0443 \u0432 \u0441\u0443\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u044d\u0442\u043e\u0439 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0437\u043a\u0438 \u043f\u043e \u0442\u0438\u043f\u0443 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 \u043e\u0434\u043d\u0438\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c<\/p>\n<p>\u041d\u0430\u043f\u0438\u0448\u0435\u043c \u0442\u0440\u0438 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>print(x) <\/code>\u0434\u043b\u044f \u0442\u0438\u043f\u043e\u0432 <code>int, float<\/code> \u0438 <code>char* <\/code>(cstring):<\/p>\n<pre><code>void print_int(int x) {printf(\"%d \", x); }  void print_float(float x) {printf(\"%.4f \", x); } void print_string(char* x) {printf(\"%s \", x); }<\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u043a\u0440\u043e\u0441\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0438\u043c \u0438\u0437 \u043f\u043e\u0434 \u043e\u0434\u043d\u0438\u043c \u0438\u043c\u0435\u043d\u0435\u043c <code>print<\/code>:<\/p>\n<pre><code>#define print(x) _Generic((X),    int: print_int,    float: print_float,    char*: print_string)(x)<\/code><\/pre>\n<p>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c, \u0447\u0442\u043e \u0437\u0430\u043f\u0438\u0441\u044c <code>print(\"hi\") <\/code>\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>print_string(\"hi\")<\/code>, <code>print(5.5) <\/code>\u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 <code>print_float(5.5) <\/code>\u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435<\/p>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0435\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u0437\u0430\u043f\u0438\u0441\u044c <code>print(\"hi\")  <\/code>\u043f\u0440\u0435\u0432\u0440\u0430\u0442\u0438\u0442\u0441\u044f \u0432 <code>_Generic((\"hi\"), int: print_int, float: print_float, char*: print_string)(\"hi\"), <\/code>\u0438 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u0432\u044b\u0431\u0435\u0440\u0435\u0442 \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0430\u0434\u043e \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0432\u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <code>_Generic(...)<\/code><\/p>\n<p><a class=\"anchor\" name=\"%D0%9D%D0%B5%D0%BE%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%BD%D0%BE%D0%B5%20%D1%87%D0%B8%D1%81%D0%BB%D0%BE%20%D0%BE%D0%B4%D0%BD%D0%BE%D1%80%D0%BE%D0%B4%D0%BD%D1%8B%D1%85%20%D0%B0%D1%80%D0%B3%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%BE%D0%B2\" id=\"\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432\">\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432&#187;><\/a><\/p>\n<h3>\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0434\u043d\u043e\u0440\u043e\u0434\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/h3>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0435\u0437 \u044f\u0432\u043d\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u0438\u0445 \u0447\u0438\u0441\u043b\u0430. \u041f\u043e\u043a\u0430\u0436\u0443 \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0434\u043b\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>print_int<\/code><\/p>\n<pre><code>void print_int(int n, ...) {   va_list argptr;   va_start(argptr, n);   int x;   for (int i = 0; i &lt; n; i++)   {     x = va_arg(argptr, int);     printf(\"%d \", x);   }   va_end(argptr); }<\/code><\/pre>\n<p>\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u0430\u043a\u0440\u043e\u0441\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u043b\u044e\u0431\u0435\u0437\u043d\u043e \u0441\u043a\u043e\u043f\u0438\u043f\u0430\u0441\u0442\u0438\u043b \u0438\u0437 \u0433\u0443\u0433\u043b\u0430 \ud83d\ude42 \u043c\u043e\u0436\u0435\u043c \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 <code>n<\/code>, \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u0435\u0440\u0432\u044b\u043c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u043c<\/p>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>\u041c\u0430\u043a\u0440\u043e\u0441 PP_NARG(&#8230;), \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0438\u0439 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432<\/p>\n<pre><code>#ifndef PP_NARG \/*       The PP_NARG macro returns the number of arguments that have been    passed to it.     https:\/\/groups.google.com\/g\/comp.std.c\/c\/d-6Mj5Lko_s  \/  #define PP_NARG(...)     PP_NARG_(VA_ARGS,PP_RSEQ_N()) #define PP_NARG_(...)     PP_ARG_N(VA_ARGS) #define PP_ARG_N( _1, _2, _3, _4, _5, _6, _7, _8, _9,_10, _11,_12,_13,_14,_15,_16,_17,_18,_19,_20, _21,_22,_23,_24,_25,_26,_27,_28,_29,_30, _31,_32,_33,_34,_35,_36,_37,_38,_39,_40, _41,_42,_43,_44,_45,_46,_47,_48,_49,_50, _51,_52,_53,_54,_55,_56,_57,_58,_59,_60, _61,_62,_63, N, ...) N #define PP_RSEQ_N() 63,62,61,60, 59,58,57,56,55,54,53,52,51,50, 49,48,47,46,45,44,43,42,41,40, 39,38,37,36,35,34,33,32,31,30, 29,28,27,26,25,24,23,22,21,20, 19,18,17,16,15,14,13,12,11,10, 9,8,7,6,5,4,3,2,1,0 #endif<\/code><\/pre>\n<\/div>\n<\/details>\n<pre><code>#define print(...)    print_int(PP_NARG(VA_ARGS), VA_ARGS)<\/code><\/pre>\n<p><em>\u041f\u0440\u0438\u043c\u0435\u0447\u0430\u043d\u0438\u0435: <\/em><code>VA_ARGS <\/code><em>\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432 \u0441\u0435\u0431\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043f\u0430\u043b\u0438 \u0432 <\/em><code>...<\/code><\/p>\n<p>\u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u0434\u0436\u0435\u0439\u043d\u0435\u0440\u0438\u043a\u043e\u0432, \u0435\u0441\u043b\u0438 \u0432\u0441\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c<\/p>\n<pre><code>#define function(x, ...) Generic((x),    int: function_int,  float: function_float,  char*: function_string)(PP_NARG(VA_ARGS) + 1, x, VA_ARGS)<\/code><\/pre>\n<p><em>\u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <\/em><code>function<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0434\u043d\u043e\u0442\u0438\u043f\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432. \u042f \u043d\u0430\u043f\u0438\u0441\u0430\u043b <code>function<\/code>, \u0430 \u043d\u0435 <code>print<\/code>, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u043b\u044f \u043d\u0430\u0448\u0435\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u044d\u0442\u043e \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442. \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0432\u0430\u043c \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u0442\u0438\u043f\u0430, \u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0431\u0443\u0434\u0435\u0442 \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u043a\u043e\u0433\u0434\u0430 \u043b\u044e\u0431\u043e\u0439 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430<\/p>\n<p><a class=\"anchor\" name=\"%D0%9D%D0%B5%D0%BE%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%BD%D0%BE%D0%B5%20%D1%87%D0%B8%D1%81%D0%BB%D0%BE%20%D0%B0%D1%80%D0%B3%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%BE%D0%B2%20%D0%BB%D1%8E%D0%B1%D0%BE%D0%B3%D0%BE%20%D1%82%D0%B8%D0%BF%D0%B0\" id=\"\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430\">\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430&#187;<\/a><\/p>\n<h3>\u041d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043b\u044e\u0431\u043e\u0433\u043e \u0442\u0438\u043f\u0430<\/h3>\n<p><a class=\"anchor\" name=\"I.%20%D0%A5%D1%80%D0%B0%D0%BD%D0%B5%D0%BD%D0%B8%D0%B5%20%D0%B8%D0%BD%D1%84%D0%BE%D1%80%D0%BC%D0%B0%D1%86%D0%B8%D0%B8%20%D0%BE%20%D1%82%D0%B8%D0%BF%D0%B0%D1%85\" id=\"I. \u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u0438\u043f\u0430\u0445\">\u0430\u0446\u0438\u0438 \u043e \u0442\u0438\u043f\u0430\u0445&#187;><\/a><\/p>\n<h3>I. \u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u0438\u043f\u0430\u0445<\/h3>\n<p>\u041c\u044b \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0432\u0438\u0434\u0430 (\u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0432\u043e\u043b\u044c\u043d\u044b\u0439) <code>hidden_print(sep, n, x1, x2, x3, ...), <\/code>\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439  \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <code>xi <\/code>\u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043d\u0443\u0436\u043d\u044b\u0439 printf. \u0414\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441 \u0443\u0436\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u043c \u0442\u0438\u043f\u043e\u043c<\/p>\n<p>\u0414\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0435\u0442 12. \u0414\u043b\u044f <code>print<\/code>&#8216;\u0430 \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. <\/p>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p><em>\u0422\u0430\u043a \u0436\u0435 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043f\u043e\u044f\u0441\u043d\u044e \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439<\/em><\/p>\n<p><em>\u0412\u0441\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0438\u043c\u0435\u043d\u0430 \u0431\u0443\u0434\u0443\u0442 \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0438 <\/em><code>cool<\/code>. \u042d\u0442\u043e \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d, \u043f\u0440\u043e\u0441\u0442\u043e \u044f \u0440\u0435\u0448\u0438\u043b \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043d\u0435\u0441\u0435\u0440\u044c\u0435\u0437\u043d\u0443\u044e, \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c\u0443\u044e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043a\u0443, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0445\u0440\u0430\u043d\u044f\u0442\u0441\u044f \u0442\u0430\u043a\u0438\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u044b\u0435, \u043d\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0435 \u0448\u0442\u0443\u0447\u043a\u0438. \u0412 \u044d\u0442\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043d\u0430 c++ \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043e\u0431\u044c\u044f\u0432\u043b\u0435\u043d\u044b \u0432 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435 \u0438\u043c\u0435\u043d <code>cool<\/code>, \u043e\u0434\u043d\u0430\u043a\u043e \u0432 \u0421\u0438 \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432 \u0438\u043c\u0435\u043d \u043d\u0435\u0442, \u0442\u0430\u043a \u0447\u0442\u043e \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0441\u044c \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u0430\u043c\u0438. \u041e\u0434\u043d\u0430\u043a\u043e \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c <code>#define print cool_print<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c <code>#undef print<\/code><\/p>\n<\/div>\n<\/details>\n<p>\u0414\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u0438\u043f\u0430\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u0431\u0443\u0434\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 <code>cool_hidden_types[12]<\/code>, \u0438\u043d\u0434\u0435\u043a\u0441 <code>cool_hidden_last<\/code>, \u043a\u0443\u0434\u0430 \u043d\u0430\u0434\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u0449\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 <code>cool_hidden_add_int<\/code>, <code>cool_hidden_add_float <\/code>\u0438 \u0442.\u0434. \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e \u0442\u0438\u043f\u0430\u0445. \u0412\u0441\u0435\u0433\u043e \u043d\u0430\u0448\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c 7 \u0442\u0438\u043f\u043e\u0432: <code>int, char*, float, double, char (?), uint, long<\/code><\/p>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>char (?)<\/p>\n<p>\u041f\u043e\u0447\u0435\u043c\u0443-\u0442\u043e \u043f\u0440\u0438 \u0437\u0430\u043f\u0438\u0441\u0438 <code>_Generic(('a'), char: fun_char)()<\/code> \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440 \u0432\u044b\u0434\u0430\u0435\u0442 \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 <em>&#171;\u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0434\u043b\u044f <\/em><code>int<\/code><em>&#171;<\/em>, \u0442\u0430\u043a \u0447\u0442\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0441\u0438\u043c\u0432\u043e\u043b \u0432 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u044b\u0445 \u043a\u0430\u0432\u044b\u0447\u043a\u0430\u0445 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f \u0438 \u043e\u043d \u0434\u0430\u0439 \u0431\u043e\u0433 \u0432\u044b\u0432\u0435\u0434\u0435\u0442\u0441\u044f \u043a\u0430\u043a <code>int<\/code><\/p>\n<\/div>\n<\/details>\n<p>\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043e \u0442\u0438\u043f\u0430\u0445 \u044f \u0440\u0435\u0448\u0438\u043b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>#define<\/code>, \u0445\u043e\u0442\u044f \u0432 \u0441\u0438 \u0435\u0441\u0442\u044c \u0438 <code>enum<\/code>. \u041d\u043e \u0440\u0430\u0437 \u0443\u0436 \u0442\u0443\u0442 \u043f\u043e\u0447\u0442\u0438 \u0432\u0435\u0441\u044c \u043a\u043e\u0434 \u043d\u0430 \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u0445, \u0442\u043e \u0433\u0443\u043b\u044f\u0442\u044c \u0442\u0430\u043a \u0433\u0443\u043b\u044f\u0442\u044c!<\/p>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>\u041a\u043e\u0434 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u043c \u0442\u0438\u043f\u043e\u0432<\/p>\n<pre><code>#define COOL_HIDDEN_INT 0 #define COOL_HIDDEN_STRING 1 #define COOL_HIDDEN_FLOAT 2 #define COOL_HIDDEN_DOUBLE 3 #define COOL_HIDDEN_CHAR 4 #define COOL_HIDDEN_UINT 5 #define COOL_HIDDEN_LONG 6 #define COOL_HIDDEN_VOID 7 int cool_hidden_types[12]; int cool_hidden_last = 0; void cool_hidden_add_int() {     cool_hidden_types[cool_hidden_last] = COOL_HIDDEN_INT;     cool_hidden_last += 1; } void cool_hidden_add_string() {     cool_hidden_types[cool_hidden_last] = COOL_HIDDEN_STRING;     cool_hidden_last += 1; } \/*\u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0438\u043f\u0430 *\/ void cool_hidden_add_void() {     cool_hidden_types[cool_hidden_last] = COOL_HIDDEN_VOID;     cool_hidden_last += 1; }<\/code><\/pre>\n<\/div>\n<\/details>\n<p><code>COOL_HIDDEN_VOID <\/code>\u0431\u0443\u0434\u0435\u0442 \u043e\u0437\u043d\u0430\u0447\u0430\u0442\u044c, \u0447\u0442\u043e \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0438\u043f \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439. \u041c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0437\u0430\u043c\u043e\u0440\u043e\u0447\u0438\u0442\u044c\u0441\u044f \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0432 16-\u0440\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435 \u0434\u043b\u044f \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u043d\u043e \u044f \u043d\u0435 \u0441\u0442\u0430\u043b \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0442\u0435\u043f\u0435\u0440\u044c generic \u043c\u0430\u043a\u0440\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>cool_hidden_add(x)<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0438\u043f\u0430<code> x<\/code><\/p>\n<pre><code>#define cool_hidden_add(x)              Generic((x),           int: cool_hidden_add_int,           char*: cool_hidden_add_string,     float: cool_hidden_add_float,     double: cool_hidden_add_double,     char: cool_hidden_add_char,     unsigned int: cool_hidden_add_uint,     long: cool_hidden_add_long,     default: cool_hidden_add_void )()<\/code><\/pre>\n<p><em>\u042d\u0442\u043e \u0431\u044b\u043b\u043e \u0441\u0430\u043c\u043e\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435&#8230;<\/em><\/p>\n<p><a class=\"anchor\" name=\"II.%20%D0%9E%D0%BF%D1%80%D0%B5%D0%B4%D0%B5%D0%BB%D0%B5%D0%BD%D0%B8%D0%B5%20%D1%87%D0%B8%D1%81%D0%BB%D0%B0%20%D0%B0%D1%80%D0%B3%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D0%BE%D0%B2%20%D0%BD%D0%B0%20%D1%83%D1%80%D0%BE%D0%B2%D0%BD%D0%B5%20%D0%BC%D0%B0%D0%BA%D1%80%D0%BE%D1%81%D0%B0\" id=\"II. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u0430\">\u0442\u043e\u0432 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u0430&#187;><\/a><\/p>\n<h3>II. \u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0443\u0440\u043e\u0432\u043d\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u0430<\/h3>\n<p><em>\u0418\u0434\u0435\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441 \u0432\u0438\u0434\u0430 <\/em><code>cool_print##n(x1, x2, ..., xn)<\/code> <em>(&#171;##&#187; \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043a\u043e\u043d\u043a\u0430\u0442\u0435\u043d\u0430\u0446\u0438\u044e \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c <\/em><code>n<\/code><em>)<\/em>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0442\u0438\u043f\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e <code>xi<\/code>, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 <code>cool_hidden_print(sep, n, x1, x2, ...)<\/code> \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c, <code>n<\/code>, \u0438 \u0432\u0441\u0435 <code>xi<\/code>. \u0420\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u0435\u043b\u044c \u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044e \u043a\u0430\u043a \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0443\u044e (\u0435\u0441\u043b\u0438 \u0442\u0430\u043a \u0432\u043e\u043e\u0431\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u0441 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u0440\u0438\u0441\u0442\u0430\u0432\u043a\u043e\u0439) \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>cool_print_sep = \" \"<\/code>, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0432 \u043b\u044e\u0431\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442<\/p>\n<p>\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043c \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435. \u0425\u043e\u0442\u044f \u043d\u0430\u0432\u0435\u0440\u043d\u043e\u0435 \u0438\u0445 \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u043a\u0440\u043e\u0441\u0430\u043c\u0438, \u043d\u043e \u043c\u043d\u0435 \u0431\u044b\u043b\u043e \u0443\u0436\u0435 \u043b\u0435\u043d\u044c. (\u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0443 \u043c\u0435\u043d\u044f \u0438 \u0442\u0430\u043a \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440  visual studio \u0437\u0430\u0431\u043b\u0443\u0434\u0438\u043b\u0441\u044f \u0432 \u043a\u0443\u0447\u0435 \u043c\u0430\u043a\u0440\u043e\u0441\u043e\u0432 \u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 \u0442\u0430\u043c, \u0433\u0434\u0435 \u0432\u0441\u0435 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f, \u043d\u043e \u043e\u0431 \u044d\u0442\u043e\u043c \u043f\u043e\u0437\u0436\u0435)<\/p>\n<pre><code>\u0412 \u043e\u0431\u0449\u0435\u043c \u0432\u0438\u0434\u0435 \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a: #define cool_print_n(x1, x2, x3, x4, ..., xn, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     ...................     cool_hidden_add(xn);     cool_hidden_print(cool_print_sep, 6, x1, x2, x3, x4, ..., xn) <\/code><\/pre>\n<details class=\"spoiler\">\n<summary><\/summary>\n<div class=\"spoiler__content\">\n<p>\u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434<\/p>\n<pre><code> #if 1 or \"hide this a big part of code\" #define cool_print_12(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_add(x5);     cool_hidden_add(x6);     cool_hidden_add(x7);     cool_hidden_add(x8);     cool_hidden_add(x9);     cool_hidden_add(x10);     cool_hidden_add(x11);     cool_hidden_add(x12);     cool_hidden_print(cool_print_sep, 12, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, x12) #define cool_print_11(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_add(x5);     cool_hidden_add(x6);     cool_hidden_add(x7);     cool_hidden_add(x8);     cool_hidden_add(x9);     cool_hidden_add(x10);     cool_hidden_add(x11);     cool_hidden_print(cool_print_sep, 11, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, x11) #define cool_print_10(x1, x2, x3, x4, x5, x6, x7, x8, x9, x10, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_add(x5);     cool_hidden_add(x6);     cool_hidden_add(x7);     cool_hidden_add(x8);     cool_hidden_add(x9);     cool_hidden_add(x10);     cool_hidden_print(cool_print_sep, 10, x1, x2, x3, x4, x5, x6, x7, x8, x9, x10) #define cool_print_9(x1, x2, x3, x4, x5, x6, x7, x8, x9, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);     cool_hidden_add(x3);     cool_hidden_add(x4);     cool_hidden_add(x5);     cool_hidden_add(x6);     cool_hidden_add(x7);     cool_hidden_add(x8);     cool_hidden_add(x9);     cool_hidden_print(cool_print_sep, 9, x1, x2, x3, x4, x5, x6, x7, x8, x9) #define cool_print_8(x1, x2, x3, x4, x5, x6, x7, x8, ...)       cool_hidden_add(x1);     cool_hidden_add(x2);  <\/code><\/pre>\n<\/div>\n<\/details>\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-321811","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321811","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=321811"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/321811\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=321811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=321811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=321811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}