var a:array [1..5] of integer; i:integer;begin randomize; for i:=1 to 5 do begin a[i]:=random(31)-15; write (a[i]:4); end; writeln; for i:=1 to 5 do begin a[i]:=a[i]*2; write (a[i]:4); end; writeln; readln;end.C++:#include <iostream>#include <ctime>#include <cstdlib>using namespace std;int main(){ int a[5]; srand (time(NULL)); for (int i = 0; i<5; i++) { a[i] = rand()%15-15; cout <<a[i] <<" "; } cout <<endl; for (int i = 0; i<5; i++) { a[i]*=2; cout <<a[i] <<" "; } return 0;
var a:array [1..5] of integer; i:integer;begin randomize; for i:=1 to 5 do begin a[i]:=random(31)-15; write (a[i]:4); end; writeln; for i:=1 to 5 do begin a[i]:=a[i]*2; write (a[i]:4); end; writeln; readln;end.C++:#include <iostream>#include <ctime>#include <cstdlib>using namespace std;int main(){ int a[5]; srand (time(NULL)); for (int i = 0; i<5; i++) { a[i] = rand()%15-15; cout <<a[i] <<" "; } cout <<endl; for (int i = 0; i<5; i++) { a[i]*=2; cout <<a[i] <<" "; } return 0;
Объяснение:
Начало
|
a , b , c
|
d = b * b - 4 * a * c
|
- D > = 0 +
| |
ДКН X1 =(-b + SQR(D)) / (2*a)
| |
| X2 =(-b - SQR(D)) / (2*a)
| |
| X1 , X2
| |
| |
| |
| Конец |
Вот и все
Программа
PRINT “Количество корней квадратного уравнения“
INPUT “Ввести a, b, c: “, a, b, c
d = b * b – 4 * a * c
IF d >= 0 THEN
IF d > 0 THEN PRINT “2 разных корня“ ELSE PRINT “2 одинаковых корня“
ELSE PRINT “Действительных корней нет“
словесная программа
Начало
Ввод a,b,c
d = b * b - 4 * a * c
Нет D 》=0 Да
X1 =(-b + SQR(D)) / (2*a)
X2 =(-b - SQR(D)) / (2*a)
X1 , X2
ДКН
Конец
Объяснение:
это правильный ответ