Using System; using System.Collections.Generic; using System.Linq; using System.Text;
namespace ConsoleApplication8 { class Program { static void Main(string[] args) { double a = double.Parse(Console.ReadLine()); double b = double.Parse(Console.ReadLine()); double c = double.Parse(Console.ReadLine());
if (a == b && b == c) { Console.WriteLine("Монотонная прогрессия"); goto a; }
if (b - a == c - b) { Console.WriteLine("Арифметическая прогрессия"); goto a; }
if (a != 0 && b != 0) { if (b / a == c / b) { Console.WriteLine("Геометрическая прогрессия"); goto a; } }
Console.WriteLine("Числа не составляют прогрессию");
По моему так: program p; var a,b,c:integer; begin writeln('первое число:'); readln(a); writeln('второе число:'); readln(b); writeln('третие число:'); readln(c); if (a>b) and (a>c) then writeln('Первое число является наибольшим'); if (a>b) and (a<c) or (a<b) and (a>c) then writeln('Первое число является средним'); if (a<b) and (a<c) then writeln('Первое число является наимешим'); if (b>a) and (b>c) then writeln('Второе число является наибольшим'); if (b>a) and (b<c) or (b<a) and (b>c) then writeln('Второе число является средним'); if (b<a) and (b<c) then writeln('Второе число является наимешим'); if (c>b) and (c>a) then writeln('Третие число является наибольшим'); if (c>b) and (c<a) or (c<b) and (c>a) then writeln('Третие число является средним'); if (c<b) and (c<a) then writeln('Третие число является наимешим'); end.
// PascalABC.NET 3.2, сборка 1417 от 28.03.2017 // Внимание! Если программа не работает, обновите версию!
begin var a,b,c:real; Read(a,b,c); // не вводить одинаковых! if a>b then if a>c then // a > [b,c] if b>c then Writeln('Среднее - второе число') else Writeln('Среднее - третье число') else Writeln('Среднее - первое число') else if b>c then // b > [a,c] if a>c then Writeln('Среднее - первое число') else Writeln('Среднее - третье число') else Writeln('Среднее - второе число') end.
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication8
{
class Program
{
static void Main(string[] args)
{
double a = double.Parse(Console.ReadLine());
double b = double.Parse(Console.ReadLine());
double c = double.Parse(Console.ReadLine());
if (a == b && b == c)
{
Console.WriteLine("Монотонная прогрессия");
goto a;
}
if (b - a == c - b)
{
Console.WriteLine("Арифметическая прогрессия");
goto a;
}
if (a != 0 && b != 0)
{
if (b / a == c / b)
{
Console.WriteLine("Геометрическая прогрессия");
goto a;
}
}
Console.WriteLine("Числа не составляют прогрессию");
a: Console.ReadKey();
}
}
}