Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace _1709
- {
- class Program
- {
- static void Main(string[] args)
- {
- double x, y, U;
- x = 0.5;
- y = 0.4;
- if (y >= -2)
- {
- if (x >= -1)
- {
- if (y <= x)
- {
- U = x + y * y * x * x;
- }
- else if (y <= -x)
- {
- U = x + y * y * x * x;
- }
- else {
- U = Math.Abs(x * x - y * y * y);
- }
- }
- else if (y <= 1)
- {
- if (y <= x)
- {
- U = x + y * y * x * x;
- }
- else if (y <= -x)
- {
- U = x + y * y * x * x;
- }
- else
- {
- U = Math.Abs(x * x - y * y * y);
- }
- }
- else
- {
- U = Math.Abs(x * x - y * y * y);
- }
- }
- else {
- U = Math.Abs(x * x - y * y * y);
- }
- Console.WriteLine(U);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement