//PascalABC.NET версия 3.2, сборка 1389
//Если программа не запускается, то обновите версию
uses System.Linq;
begin
writeln('III');
var a := ReadArrInteger('Документы', ReadInteger('n=')).ToList;
writeln;
while a.Any() do
begin
write(a[0], ' ');
a.RemoveAt(0);
if not a.Any then break;
write(a.Last, ' ');
a.RemoveAt(a.Count - 1);
if not a.Any then break;
var n := 0;
if a.Count > 1 then n := a.Count div 2 - 1;
write(a[n], ' ');
a.RemoveAt(n);
end;
end.
Объяснение:
Как-то так, наверное
Объяснение:
#include <iostream>
#include <cmath>
using namespace std;
int main()
{
double a, x, b, c, D;
cout<<"Введите a: "; cin >> a;
cout<<"Введите b: "; cin >> b;
cout<<"Введите c: "; cin >> c;
D = pow(b,2)-4*a*c;
if(D>0){
cout << "x1 = " << ((-1)*b+sqrt(D))/(2*a)<<endl;
cout << "x2 = " <<((-1)*b-sqrt(D))/(2*a)<<endl;
}
else if(D==0){
cout << "x = " << ((-1)*b)/(2*a)<<endl;
}
else{
D*=(-1);
cout<< "x1 = " << ((-1)*b)/(2*a) <<"+"<< (sqrt(D))/(2*a) << "*i" <<endl;
cout<< "x2 = " << ((-1)*b)/(2*a) <<"-"<< (sqrt(D))/(2*a) << "*i" <<endl;
}
return 0;
}