Akioni

КАК ЕТО РАБОТАЕТ!:!?!??!?!?! ОЙ А ОНО И В ПРАВДУ РАБОТАЕТ

Oct 17th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.38 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using static System.Math;
  7. using System.Timers;
  8. using System.Diagnostics;
  9.  
  10.  namespace ConsoleApplication40
  11. {
  12.     class Program
  13.     {
  14.        
  15.         static void Main(string[] args)
  16.         {
  17.             //
  18.             Console.WriteLine("Press any key to start the calculation : ");
  19.             Console.ReadKey();
  20.             Console.Clear();
  21.             //
  22.             Stopwatch stopWatch = new Stopwatch();
  23.             stopWatch.Start();
  24.             TimeSpan ts = stopWatch.Elapsed;
  25.             string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
  26.             //
  27.             int x = 1;
  28.             double e = 0;
  29.             int i = 1;
  30.             //
  31.             for (int N = 1; N <= 100; N++)
  32.             {
  33.                 e += Pow(Cos(i * Pow(x, 3)), 4);
  34.                 if (N == 101)
  35.                 {                  
  36.                     N = 0;
  37.                     x++;              
  38.                 }
  39.                 if (x == 11)
  40.                 {
  41.                     break;
  42.                 }
  43.             }
  44.             //
  45.             stopWatch.Stop();
  46.             Console.WriteLine("RunTime " + elapsedTime);
  47.  
  48.             Console.ReadKey();
  49.         }        
  50.     }
  51.     }
Advertisement
Add Comment
Please, Sign In to add comment