Pascal:
const a:array [1..5,1..5] of integer = ((1,2,3,4,5),
(6,7,8,9,10),
(11,12,13,14,15),
(16,17,18,19,20),
(21,22,23,24,25));
var I,j:integer;
begin
for i:=1 to 5 do
for j:=1 to 5 do write (a[I,j],' ');
writeln;
for i:=1 to 5 do
begin
for j:=1 to 5 do write (a[I,j]:3);
writeln;
end;
readln;
end.
C++:
#include
#include
using namespace std;
int main()
{
int a[5][5] = {{1,2,3,4,5},
{6,7,8,9,10},
{11,12,13,14,15},
{16,17,18,19,20},
{21,22,23,24,25},};
for (int I = 0; I<5; I++)<br> for (int j = 0; j<5; j++)<br> cout <<a[I][j] <<" ";<br> cout <<endl;<br> for (int I = 0; I<5; I++)<br> {
for (int j = 0; j<5; j++)<br> cout <<setw(3) <<a[I][j];<br> cout <<endl;<br> }
return 0;
}