var m, n, i, j: integer; s: real; a: array[,] of real;
begin write('Введите S: '); read(s); write('Введите M, N: '); read(m, n); setlength(a, m + 1, n + 1); writeln('Введите элементы матрицы: '); for i := 1 to m do for j := 1 to n do read(a[i, j]); for i := 1 to m do begin for j := 1 to n do if a[i, j] <> s then begin writeln(a[i, j]); break; end; if a[i, j] = s then writeln('-'); end; end.
#include <iostream> #include <stdio.h> using namespace std;
int main(){ int y; cin>>y; y=y%12; switch (y){ case 4:{cout<<"Mouse"; break;} case 5:{cout<<"Bull";break;} case 6:{cout<<"Tiger";break;} case 7:{cout<<"Rabbit";break;} case 8:{cout<<"Dragon";break;} case 9:{cout<<"Snake";break;} case 10:{cout<<"Horse";break;} case 11:{cout<<"Goat";break;} case 0:{cout<<"Monkey";break;} case 1:{cout<<"Cock";break;} case 2:{cout<<"Dog";break;} case 3:{cout<<"Pig";break;} } cin.get(); cin.get(); return 0; }
m, n, i, j: integer;
s: real;
a: array[,] of real;
begin
write('Введите S: ');
read(s);
write('Введите M, N: ');
read(m, n);
setlength(a, m + 1, n + 1);
writeln('Введите элементы матрицы: ');
for i := 1 to m do
for j := 1 to n do
read(a[i, j]);
for i := 1 to m do
begin
for j := 1 to n do
if a[i, j] <> s then
begin
writeln(a[i, j]);
break;
end;
if a[i, j] = s then
writeln('-');
end;
end.
Пример:
Введите S: 7
Введите M, N: 3 4
Введите элементы матрицы:
7 4 3 7
3 5 1 4
7 7 7 7
4
3
-
#include <stdio.h>
using namespace std;
int main(){
int y;
cin>>y;
y=y%12;
switch (y){
case 4:{cout<<"Mouse"; break;}
case 5:{cout<<"Bull";break;}
case 6:{cout<<"Tiger";break;}
case 7:{cout<<"Rabbit";break;}
case 8:{cout<<"Dragon";break;}
case 9:{cout<<"Snake";break;}
case 10:{cout<<"Horse";break;}
case 11:{cout<<"Goat";break;}
case 0:{cout<<"Monkey";break;}
case 1:{cout<<"Cock";break;}
case 2:{cout<<"Dog";break;}
case 3:{cout<<"Pig";break;}
}
cin.get();
cin.get();
return 0;
}