Advertisement
Guest User

var13

a guest
Apr 9th, 2020
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.85 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.  
  7. namespace var13
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double z1, z2, a, b;
  14.             Console.Write("a = ");
  15.             a = Convert.ToDouble(Console.ReadLine());
  16.             Console.Write("b = ");
  17.             b = Convert.ToDouble(Console.ReadLine());
  18.             if ((Math.Cos(a) - Math.Sin(2*b - a) == 0) || (Math.Cos(2*b) == 0)) Console.WriteLine("Error!");
  19.             else
  20.             {
  21.                 z1 = (Math.Sin(a) + Math.Cos(2*b - a)) / (Math.Cos(a) - Math.Sin(2 * b - a));
  22.                 z2 = (1 + Math.Sin(2*b)) / (Math.Cos(2*b));
  23.                 Console.WriteLine("z1 = {0}\nz2 = {1}", z1, z2);
  24.             }
  25.  
  26.             Console.ReadKey();
  27.         }
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement