//Pascal ABC.NET v3.1 сборка 1172
var
ma: array of array of integer;
n, m, i, j, max, maxi, maxj: integer;
f: text;
s, st: string;
begin
randomize;
readln(n);
readln(m);
max := -1;
setlength(ma, n);
for i := 0 to n - 1 do
setlength(ma[i], m);
writeln('Matrix:');
for i := 0 to n - 1 do
begin
writeln;
for j := 0 to m - 1 do
begin
ma[i, j] := random(101);
write(ma[i, j]:4);
if max < ma[i, j] then
begin
max := ma[i, j];
maxi := i;
maxj := j;
end;
end;
end;
assign(f, 'text.txt');
rewrite(f);
for i := 0 to m - 1 do
write(f, ma[maxi, i]:4);
writeln(f, ' ');
for i := 0 to n - 1 do
write(f, ma[i, maxj]:4);
close(f);
writeln;
writeln('File:');
assign(f, 'text.txt');
reset(f);
while not Eof(f) do
begin;
readln(f, st);
s := s + st + chr(10) + chr(13);
end;
close(f);
write(s);
end.
Пример ввода:
3
4
Пример вывода:
Matrix:
30 29 3 61
64 4 99 36
45 9 85 19
File:
64 4 99 36
3 99 85
11114444 Бит = 0.00129389 <span>Гигабайт</span>
Itranslateтакая программка Где вы можете переводить слова
<u>// PascalABC.NET </u>
<u>// Версия 3.3.5 сборка 1662 (29.04.2018)</u>
begin
for var i := ReadInteger('n->') to ReadInteger('k->') do
if i.ToString.OrderBy(t -> t).AdjacentGroup.Where(t -> t.Count = 3).Count > 0
then i.Println;
end.
<u>Пример:</u>
k-> 1170
n-> 1111
1112
1113
1114
1115
1116
1117
1118
1119
1121
1131
1141
1151
1161
//Dev C++ 4.9.9.2
#include <iostream>
using namespace std;
int main(){
int n;
cin>>n;
cout<<endl;
int **ma;
ma=(int **)malloc(sizeof(int*)*n);
for (int i=0;i<n;i++){
ma[i]=(int*)malloc(sizeof(int)*n);}
for(int i=0;i<n;i++){
for(int j=0;j<n;j++)
cin>>ma[i][j];
cout<<endl;}
for(int i=0;i<n-1;i++)
for(int j=i+1;j<n;j++)
if(ma[i][j]!=ma[j][i]){
cout<<"NO";
cin.get();
cin.get();
return 0;}
cout<<"YES";
cin.get();
cin.get();
return 0;
}
Пример ввода:
4
1
2
3
4
2
1
2
3
3
2
1
4
4
3
4
1
Пример вывода:
YES