Pascal:
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
#include
#include
using namespace std;
int main()
{
int a[5];
srand (time(NULL));
for (int i = 0; i<5; i++)<br> {
a[i] = rand()%15-15;
cout <<a[i] <<" "; <br> }
cout <<endl;<br> for (int i = 0; i<5; i++)<br> {
a[i]*=2;
cout <<a[i] <<" "; <br> }
return 0;
}