Int main ()
{
int x;
std::cin >>x;
if x>0 std::cout << "1" else
if x<0 std::cout << "-1" else
std::cout << "0";
return 0;
}
//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
program test;
var a, b: integer;
begin
write('Enter A: ');
readln(a);
write('Enter B: ');
readln(b);
writeln('Area = ', a*b);
readln;
end.
Program a;
var a: integer;
begin
writeln ('Vvedite chislo: ');
readln(a);
if (a < 0) then write('0')
else if ((a >= 0) and (a <= 18)) then write('1')
else write ('2');
end.