Advertisement
Guest User

Untitled

a guest
Sep 24th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.32 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3.  
  4. namespace HelloApp
  5. {
  6.     public class Program
  7.     {
  8.         public static void Main(string[] args)
  9.         {
  10.  
  11.             double  y, m;
  12.             double x = 1;
  13.             Console.WriteLine("Введите a1");
  14.             double a1 = double.Parse(Console.ReadLine());
  15.             Console.WriteLine("Введите b1");
  16.             double b1 = double.Parse(Console.ReadLine());
  17.             Console.WriteLine("Введите c1");
  18.             double c1 = double.Parse(Console.ReadLine());
  19.             Console.WriteLine("Введите a2");
  20.             double a2 = double.Parse(Console.ReadLine());
  21.             Console.WriteLine("Введите b2");
  22.             double b2 = double.Parse(Console.ReadLine());
  23.             Console.WriteLine("Введите c2");
  24.             double c2 = double.Parse(Console.ReadLine());
  25.  
  26.             if ((a1 * b1) != (a2 * b2))
  27.             {
  28.                 Console.WriteLine("Точек пересечения не существует");
  29.             }
  30.             else
  31.             {
  32.                 y = (c1 - a1 * x) / b1;
  33.                 m = (a2 * x + b2 * ((c1 - a1 * x) / b1));
  34.                 Console.WriteLine(m);
  35.             }
  36.                            
  37.                 Console.Read();
  38.            
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement