Var f:text; ars:array of string; s,s1:string; min,n,i:integer; begin n:=1; min:=integer.MaxValue; assign(f,'text.txt'); reset(f); while not(Eof(f)) do begin readln(f,s); s1:=s; s:=s.Trim; i:=1; while i<>length(s) do if (s[i]=' ') and (s[i+1]=' ') then delete(s,i,1) else inc(i); if ((s.split).length<=min) and ((s.split).length<>0) then begin if (s.split).length=min then begin inc(n); setlength(ars,n); ars[n-1]:=s1; end else begin n:=1; setlength(ars,n); ars[n-1]:=s1; end; min:=(s.split).length; end; end; close(f); assign(f,'text1.txt'); rewrite(f); for i:=0 to n-1 do writeln(f,ars[i]); close(f); end.
class Program
{
static void Main(string[] args)
{
int a = int.Parse(Console.ReadLine());
int b = int.Parse(Console.ReadLine());
int x = int.Parse(Console.ReadLine());
int y = int.Parse(Console.ReadLine());
int z = int.Parse(Console.ReadLine());
if (x <= a && y <= b || y <= a && x <= b ||
x <= a && z <= b || z <= a && x <= b ||
z <= a && y <= b || y <= a && z <= b)
Console.WriteLine("Пройдет");
else
Console.WriteLine("Не пройдет");
Console.ReadKey();
}
}
Объяснение:
.