Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using static System.Math;
- using System.Timers;
- using System.Diagnostics;
- namespace ConsoleApplication40
- {
- class Program
- {
- static void Main(string[] args)
- {
- //
- Console.WriteLine("Press any key to start the calculation : ");
- Console.ReadKey();
- Console.Clear();
- //
- Stopwatch stopWatch = new Stopwatch();
- stopWatch.Start();
- TimeSpan ts = stopWatch.Elapsed;
- string elapsedTime = String.Format("{0:00}:{1:00}:{2:00}.{3:00}", ts.Hours, ts.Minutes, ts.Seconds, ts.Milliseconds / 10);
- //
- int x = 1;
- double e = 0;
- int i = 1;
- //
- for (int N = 1; N <= 100; N++)
- {
- e += Pow(Cos(i * Pow(x, 3)), 4);
- if (N == 101)
- {
- N = 0;
- x++;
- }
- if (x == 11)
- {
- break;
- }
- }
- //
- stopWatch.Stop();
- Console.WriteLine("RunTime " + elapsedTime);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment