@@ -0,0 +1,1251 @@
+package com.javarush.task.task16.task1622;%0A%0A/* %0A%D0%9F%D0%BE%D1%81%D0%BB%D0%B5%D0%B4%D0%BE%D0%B2%D0%B0%D1%82%D0%B5%D0%BB%D1%8C%D0%BD%D1%8B%D0%B5 %D0%B2%D1%8B%D0%BF%D0%BE%D0%BB%D0%BD%D0%B5%D0%BD%D0%B8%D1%8F %D0%BD%D0%B8%D1%82%D0%B5%D0%B9%0A*/%0A%0Apublic class Solution %7B%0A    public volatile static int COUNT = 4;%0A%0A    public static void main(String%5B%5D args) throws InterruptedException %7B%0A        for (int i = 0; i %3C COUNT; i++) %7B%0A            new SleepingThread().join();%0A            //%D0%BD%D0%B0%D0%BF%D0%B8%D1%88%D0%B8%D1%82%D0%B5 %D1%82%D1%83%D1%82 %D0%B2%D0%B0%D1%88 %D0%BA%D0%BE%D0%B4%0A        %7D%0A    %7D%0A%0A    public static class SleepingThread extends Thread %7B%0A        private static volatile int threadCount = 0;%0A        private volatile int countDownIndex = COUNT;%0A%0A        public SleepingThread() %7B%0A            super(String.valueOf(++threadCount));%0A            start();%0A        %7D%0A%0A        public void run() %7B%0A            try %7B%0A                while (true) %7B%0A                    System.out.println(this);%0A                    if (--countDownIndex == 0) %7B%0A                        Thread.sleep(10);%0A                        return;%0A                    %7D else if (countDownIndex %3C 0)%0A                        throw new InterruptedException();%0A                %7D%0A            %7D catch (InterruptedException e) %7B%0A                System.out.println(%22%D0%9D%D0%B8%D1%82%D1%8C %D0%BF%D1%80%D0%B5%D1%80%D0%B2%D0%B0%D0%BD%D0%B0%22);%0A            %7D%0A        %7D%0A%0A        public String toString() %7B%0A            return %22#%22 + getName() + %22: %22 + countDownIndex;%0A        %7D%0A    %7D%0A%7D%0A

Complete task1622