using System;
namespace Interesting {
class Program {
static void Main() {
float Max = 0;
float Sum = 0;
float N = 0;
string s;
float num;
Console.WriteLine("Введите последовательность чисел. Для окончания введите пустую строку");
try {
while (true) {
Console.WriteLine("Введите число");
s = Console.ReadLine();
num = Convert.ToSingle(s);
Max = (num > Max) ? num : Max;
Sum += num;
N++;
}
}
catch (Exception e) {
Console.WriteLine("Ввод закончен");
}
Console.WriteLine("Максимальное = {0}, Среднее = {1}", Max, Sum / N);
}
}
}
Program R1;
Var n:integer;
begin
assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);
readln(n);
if n>0 then n:=n+1 else
n:=abs(n mod 2) ; {примечание-остаток будет положительным)
writeln(n);
close(input);
close(output);
end.
2 задача
Program R1;
Var n,l:integer;
begin
assign(input,'input.txt');
reset(input);
assign(output,'output.txt');
rewrite(output);
readln(n);
if (n mod 10)>(n div 10) then writeln('2>1') else
if (n mod 10)<(n div 10) then writeln('2<1') else
if (n mod 10)=(n div 10) then writeln('2=1');
close(input);
close(output);
end.