zed_com

pract10(1)

Nov 11th, 2016
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using System.IO;
  3. namespace C
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             try
  10.             {
  11.                 StreamReader f_r = new StreamReader("C:\\users\\read.txt");
  12.             }
  13.             catch
  14.             {
  15.                 StreamWriter f_r = new StreamWriter("C:\\users\\read.txt");
  16.                 f_r.WriteLine("1,2\n20\n40\n2");
  17.                 f_r.Close();
  18.             }
  19.             StreamReader f = new StreamReader("C:\\users\\read.txt");
  20.             double k = Convert.ToDouble(f.ReadLine());
  21.             int xmin = Convert.ToInt32(f.ReadLine());
  22.             int xmax = Convert.ToInt32(f.ReadLine());
  23.             int dx = Convert.ToInt32(f.ReadLine());
  24.             StreamWriter f_w = new StreamWriter("C:\\users\\write.txt", true);
  25.  
  26.             for(int i = xmin; i <= xmax; i+=dx)
  27.                 f_w.WriteLine("({0}):{1:0.00}", i, Math.Pow(1 / Math.Tan(k * i), 1 / 3) + Math.Cos(k * i) / Math.Log(Math.Sin(k * i)));
  28.             f_w.Close();
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment