@@ -0,0 +1,1097 @@
+package ru.apetrov;%0A%0A/**%0A * Created by Andrey on 01.07.2017.%0A */%0Apublic class MultithreadingProblems %7B%0A%0A    /**%0A     * count.%0A     */%0A    private static int count = 0;%0A%0A    /**%0A     * main.%0A     * @param args args.%0A     * @throws InterruptedException exeption.%0A     */%0A    public static void main(String%5B%5D args) throws InterruptedException %7B%0A%0A        for (int i = 0; i %3C 100; i++) %7B%0A            Thread a = new Thread(new Runnable() %7B%0A                @Override%0A                public void run() %7B%0A                    count++;%0A                %7D%0A%0A            %7D);%0A%0A            Thread b = new Thread(new Runnable() %7B%0A                @Override%0A                public void run() %7B%0A                    if (count %25 2 == 0) %7B%0A                        try %7B%0A                            Thread.sleep(1);%0A                        %7D catch (InterruptedException e) %7B%0A                            e.printStackTrace();%0A                        %7D%0A                        System.out.println(count);%0A                    %7D%0A                %7D%0A            %7D);%0A%0A            a.start();%0A            b.start();%0A        %7D%0A    %7D%0A%7D%0A

add Lesson-6.2.1