using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
namespace ConsoleApplication1
{
class Program
{
static double n = 1;
static object locker = new object();
static double eps = 0.000001, sum = 0, prev = 0;
static void Function_of_thread()
{
lock (locker)
{
prev = sum;
sum += 1 / (Math.Pow(n, 4));
++n;
Console.WriteLine("Япоток №" + n + " SUM=" + sum);
}
}
static void Main(string[] args)
{
for (int i = 0; i < 10; i++)
{
Thread thr = new Thread(Function_of_thread);
thr.Start();
}
Console.Read();
}
}
}