Advertisement
Guest User

Untitled

a guest
Sep 20th, 2019
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.53 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 _1709
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double x, y, U;
  14.  
  15.             x = 0.5;
  16.             y = 0.4;
  17.  
  18.             if (y >= -2)
  19.             {
  20.                 if (x >= -1)
  21.                 {
  22.                     if (y <= x)
  23.                     {
  24.                         U = x + y * y * x * x;
  25.                     }
  26.                     else if (y <= -x)
  27.                     {
  28.                         U = x + y * y * x * x;
  29.                     }
  30.                     else {
  31.                         U = Math.Abs(x * x - y * y * y);
  32.                     }
  33.                 }
  34.                 else if (y <= 1)
  35.                 {
  36.                     if (y <= x)
  37.                     {
  38.                         U = x + y * y * x * x;
  39.                     }
  40.                     else if (y <= -x)
  41.                     {
  42.                         U = x + y * y * x * x;
  43.                     }
  44.                     else
  45.                     {
  46.                         U = Math.Abs(x * x - y * y * y);
  47.                     }
  48.                 }
  49.                 else
  50.                 {
  51.                     U = Math.Abs(x * x - y * y * y);
  52.                 }
  53.             }
  54.             else {
  55.                 U = Math.Abs(x * x - y * y * y);
  56.             }
  57.  
  58.            
  59.  
  60.             Console.WriteLine(U);
  61.  
  62.             Console.ReadKey();
  63.  
  64.  
  65.         }
  66.     }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement