Кто может нарисовать Блок Схему к этой задачки
procedure TForm1.Button1Click(Sender: TObject);
var a:array[0..9] of integer;
i:integer;
begin
for i:=0 to 9 do
a[i]:=StrToInt(memo1.lines[i]);
for i:=0 to 9 do
begin
if a[i]mod 2=0 then
a[i]:=0
else
a[i]:=1;
end;
for i:=0 to 9 do
memo2.Lines[i]:=IntToStr(a[i]);
end;
end.
n = 3;
m = 3;
var
i, j: integer;
a, b: array[1..n, 1..m] of integer;
begin
for i := 1 to n do
begin
for j := 1 to m do
begin
a[i, j] := random(20) - 10;
write(a[i, j]:3, ' ');
end;
writeln;
end;
writeln;
for i := 1 to n do
begin
for j := 1 to m do
begin
if ((i + j) mod 2 = 1) and (a[i, j] < 0) then
a[i, j] := sqr(a[i, j]);
write(a[i, j]:4, ' ');
end;
writeln;
end;
end.
1)
#include <iostream>
#include <time.h>
using namespace std;
int main()
{
srand(time(NULL));
int N[100];
for(int i=0;i<100;i++){
N[i] = rand();
}
for(int i=0;i<100;i++)
cout << N[i] << " ";
}
cout << endl;
system("pause");
return 0;
}
2)
#include <iostream>
#include <time.h>
using namespace std;
int main()
{
srand(time(NULL));
double N[5];
for(int i=0;i<5;i++)
N[i] = -1000 + rand()%1051;
for(int i=0;i<5;i++)
cout << N[i] << " ";
cout << endl;
system("pause");
return 0;
}
3)
#include <iostream>
using namespace std;
int main()
{
double N[1000];
N[0] = 2;
for(int i=1;i<1000;i++)
N[i] = N[i-1] * 2;
for(int i=0;i<1000;i++)
cout << N[i] << " ";
cout << endl;
system("pause");
return 0;
}
Объяснение: