На языке C++ будет так:
#include <iostream>
#include <math.h>
using namespace std;
int main()
{
int a,b,c;
double D, x1, x2;
cout<<"Введите a"<<endl;
cin >>a;
cout<<"Введите b"<<endl;
cin >>b;
cout<<"Введите c"<<endl;
cin >>c;
if (a == 0){
cout<<"Коэффициент a не может быть равен 0"<<endl;
return 0;
}
D = b*b - 4 * a * c;
if (D >= 0){
if (D == 0){
x1 = -(double)b /(2*a);
cout<<"x = "<<x1<<endl;
}
else{
x1 = (-b + sqrt(D)) / (2*a);
x2 = (-b - sqrt(D)) / (2*a);
cout<<"x1 = "<<x1<<endl;
cout<<"x2 = "<<x2<<endl;
}
}
else{
cout<<"Корней нет. D = "<<D<<endl;
}
return 0;
}
var n:integer;
a,b,c,d:integer; x,y,z:real;
begin
read(n);
if n>999 then begin
a:=n div 1000;
b:=n mod 1000 div 100;
c:=n mod 100 div 10;
d:=n mod 10 div 1;
x:=(a-b);
y:=(b-c);
z:=(c-d);
if a>b then write(n*2) else if (x=y) and (y=z) then write ('Arif posledovatelnost');
if (x<>y) and (y<>z) then write(n*2);
end
else write('Chislo ne 4 znachnoe');
end.