kridnyuta
25.06.2022 03:18

Нужно написать решение на C# Даны 8 различных чисел. Определить максимальное из них, используя функцию определения максимального из двух чисел.

Нажмите на рекламу ниже и сразу увидите ответ
Популярные вопросы:
Ответ:
abdrahmanova136
14.06.2021 12:00

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

namespace ConsoleApp1

{

   class Program

   {

       static void Main(string[] args)

       {

           int a= Int32.Parse(Console.ReadLine());

           int b = Int32.Parse(Console.ReadLine());

           int c = Int32.Parse(Console.ReadLine());

           int d = Int32.Parse(Console.ReadLine());

           int e = Int32.Parse(Console.ReadLine());

           int f = Int32.Parse(Console.ReadLine());

           int g = Int32.Parse(Console.ReadLine());

           int h = Int32.Parse(Console.ReadLine());

           b = Math.Max(a, b);

           c = Math.Max(b, c);

           d = Math.Max(c, d);

           e = Math.Max(d, e);

           f = Math.Max(e, f);

           g = Math.Max(f, g);

           h = Math.Max(g, h);

           Console.WriteLine(h);

       }

   }

}

0,0(0 оценок)
Полный доступ
Позволит учиться лучше и быстрее. Неограниченный доступ к базе и ответам от экспертов и ai-bota Оформи подписку
logo
Начни делиться знаниями
Вход Регистрация
Что ты хочешь узнать?
Спроси ai-бота