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 _48_zadacha
- {
- class Program
- {
- static void Main(string[] args)
- {
- Console.Write("Enter x: ");
- double x = double.Parse(Console.ReadLine());
- //a pod tochka
- Console.WriteLine("A pod tochka:");
- if (x <= 0)
- {
- Console.WriteLine("y= " + xIsNegative(x));
- }
- else
- {
- Console.WriteLine("y= " + xIsPositive(x));
- }
- }
- private static double xIsNegative(double x)
- {
- return 5 * x + 1;
- }
- private static double xIsPositive(double x)
- {
- return 1 - x;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement