Var i:integer;
begin
for i:=100 to 999 do if(i mod 6 =0) and (i mod 4 = 0) and (i mod 10 = 8) then write(i, ' ');
end.
{While}
i:=100;
while i<=999 do begin
if( if(i mod 6 =0) and (i mod 4 = 0) and (i mod 10 = 8) then write(i, ' '); inc(i); end;
{Repeat}
repeat
if(i mod 6 =0) and (i mod 4 = 0) and (i mod 10 = 8) then write(i, ' ');
inc(i); end;
until i<1000;
#include <iostream>
using namespace std;
int main(void)
{const int n=3;
const int m=3;
int ma[n][m];
int c;
cout<<"First matrix"<<endl;
for(int i=0;i<n;i++)
{for(int j=0;j<m;j++)
{ma[i][j]=i+j;
cout<<ma[i][j]<<" ";}
cout<<endl;}
for(int i=0;i<n/2;i++){
for(int j=0;j<m;j++)
{c=ma[i][j];
ma[i][j]=ma[n-i-1][j];
ma[n-1-i][j]=c;}}
cout<<"Final matrix"<<endl;
for(int i=0;i<n;i++)
{for(int j=0;j<m;j++)
cout<<ma[i][j]<<" ";
cout<<endl;}
return 0;
}
Пример работы программы(n=3,m=3):
First matrix:
0 1 2
1 2 3
2 3 4
Final matrix:
2 3 4
1 2 3
0 1 2
Var i:integer;
begin
for i:=100 to 999 do if(i mod 6 =0) and (i mod 4 = 0) and (i mod 10 = 8) then write(i, ' ');
end.
{While}
Var i:integer;
begin
i:=100;
while i<=999 do begin
if( if(i mod 6 =0) and (i mod 4 = 0) and (i mod 10 = 8) then write(i, ' '); inc(i); end;
end.
{Repeat}
Var i:integer;
begin
i:=100;
repeat
begin
if(i mod 6 =0) and (i mod 4 = 0) and (i mod 10 = 8) then write(i, ' ');
inc(i); end;
until i<1000;
end.