using System;
using System.Collections.Generic;
namespace Num
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Введите количество элементов: ");
int N = Int32.Parse(Console.ReadLine());
Console.WriteLine("Введите элементы через enter: ");
List<int> numbers = new List<int>();
for(int i = 0; i < N; ++i)
{
int temp = Int32.Parse(Console.ReadLine());
numbers.Add(temp);
}
Console.WriteLine("Элемены значения которых совпадают с их индексом:");
for (int i = 0; i < N; ++i)
{
if (numbers[i] == i)
Console.Write(numbers[i] + " ");
}
Console.WriteLine();
Console.ReadKey();
}
}
}
В первом переменная a будет равна 4
Во втором переменная b будет равна 48
Медична система,Геоінформаційні системи
//====================1=====================
float a, b, c;
cout<<"Введите a: ";
cin>>a;
cout<<"Введите b: ";
cin>>b;
cout<<"Введите c: ";
cin>>c;
float D=b*b-4*a*c;
cout<<"Ответ: ";
if(D>0)
cout<<"x1 = "<<(-b+sqrt(D))/2*a<<", x2 = "<<(-b-sqrt(D))/2*a;
else if(D==0)
cout<<"x = "<<-b/2*a;
else
cout<<"корней нет";
cout<<endl
//====================2=====================
float a, b, c;
cout<<"Введите a: ";
cin>>a;
cout<<"Введите b: ";
cin>>b;
cout<<"Введите c: ";
<span>cin>>c;</span>
cout<<"Наибольшее число: <span>";</span>
if(a>c)
if(a>b)
cout<<"a ("<<a<<")";
else
cout<<"b ("<<b<<")";
else if(c>b)
cout<<"c ("<<c<<")";
Var x,y:longint;
Begin
Readln(x);
Y:=y-2*x;
Writeln(y);
End.