Guest User

Untitled

a guest
Jan 20th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.60 KB | None | 0 0
  1. using System;
  2.  
  3. namespace SAA
  4. {
  5.     class Func1
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string input;
  10.             double x,y;
  11.  
  12.             Console.Write("Введите число x: ");
  13.             input = Console.ReadLine();
  14.             input = input.Replace('.', ',');
  15.             x = Double.Parse(input);
  16.            
  17.             if (x >= 0.9)
  18.             {
  19.                 y = 1 / Math.Pow(0.1 + x, 2);
  20.             }
  21.             else if (x >= 0 && x < 0.9)
  22.             {
  23.                 y = 0.2 * x + 0.1;
  24.             }
  25.             else if (x<0)
  26.             {
  27.                 y = x * x + 0.2;
  28.             }
  29.             else
  30.             {
  31.                 Console.WriteLine("ERROR");
  32.                 return;
  33.             }
  34.            
  35.             Console.WriteLine("Ответ: " + y);
  36.             Console.ReadLine();
  37.         }
  38.     }
  39. }
Add Comment
Please, Sign In to add comment