Const n=10;
var a:array[1..n+1] of integer;
i,j,b:integer;
begin
Randomize;
writeln('Исходный массив:');
a[1]:=random(51);
write(a[1],' ');
for i:=2 to n do
begin
a[i]:=a[i-1]+random(51);
write(a[i],' ');
end;
writeln;
write('b = ');
readln(b);
j:=1;
while (j<=n)and(a[j]<b) do j:=j+1;
for i:=n downto j do a[i+1]:=a[i];
a[j]:=b;
for i:=1 to n+1 do write(a[i],' ');
end.
Пример:
Исходный массив:
3 21 47 74 104 134 146 177 184 222
b = 120
3 21 47 74 104 120 134 146 177 184 222
Var
a,b,c,d:real;
begin
write('Введите A=');read(a);
write('Введите B=');read(b);
write('Введите C=');read(c);
D:=sqr(b)-4*a*c;
if D<0 then begin
writeln('D=',D,' ', 'Нет корней');end;
if D=0 then begin
writeln('D=',D,' ', 'x1=', -b/(2*a));end;
if D>0 then begin
writeln('D=',D,' ','x1=',(-b-sqrt(d))/(2*a));
writeln('D=',D,' ','x2=',(-b+sqrt(d))/(2*a));
end;
end.
<span>выбирай
#include <stdio.h>
#include <stdlib.h>
struct LIST {
int number;
struct LIST *next;
};
//-----------------------------------------------------------------------------
void Push(struct LIST** list, int number) {
struct LIST* node = malloc(sizeof(struct LIST));
node->number = number;
node->next = *list;
*list = node;
}
//-----------------------------------------------------------------------------
void Print(const struct LIST* list) {
if (list) {
Print(list->next);
printf("\%d ", list->number);
}
}
//-----------------------------------------------------------------------------
int main() {
int i = 10;
struct LIST* list = NULL;
while (i--) {
Push(&list, i + 1);
}
</span>
//---(это разделение разных программ)