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;
- namespace prac_5_ex_1
- {
- class Program
- {
- static double max(double a, double b)
- {
- if (a > b) return a;
- else return b;
- }
- static void Main(string[] args)
- {
- Console.Write("Введите x: ");
- double x = double.Parse(Console.ReadLine());
- Console.Write("Введите y: ");
- double y = double.Parse(Console.ReadLine());
- Console.WriteLine("z = {0}", max(x, 2*y-x) + max(5*x+3*y, y));
- Console.ReadKey();
- }
- }
- }
Add Comment
Please, Sign In to add comment