Ответ:
program Friendly;
uses
SysUtils; // для IntToStr
var
a, b, i, pa, pb: LongInt;
sa, sb: string;
f: Boolean;
begin
Write ('A, B = ');
ReadLn (a, b);
sa := IntToStr (a);
sb := IntToStr (b);
f := True;
for i := 0 to 9 do begin
pa := Pos (IntToStr (i), sa);
pb := Pos (IntToStr (i), sb);
if ((pa <> 0) and (pb = 0)) or ((pa = 0) and (pb <> 0)) then begin
f := False;
Break;
end;
end;
if f then
WriteLn ('YES')
else
WriteLn ('NO');
ReadLn;
end.
1) - винчестер
2) - память
Написано на Pascal:
Program ArraySequence;
Var a: Array [1..10] Of Integer;
i: Integer;
Begin
a[0] := 2;
For i := 1 To 9 Do
a[i] := 2*a[i-1] - 1;
For i := 0 To 9 Do
Write(a[i], ' ');
ReadLn;
End.<span>
</span>
Program zad1;
Var
x,B1,B2,B3,B4,B5,y:real;
begin
writeln('Введите X');
readln(x);
B1:=x+1;
B2:= 1/B1;
B3:= B2-1;
B4:= B2+1;
B5:= B3/B4;
y:= B5-1;
writeln('Ответ: ',y:6:2);
end.
#include <bits/stdc++.h>
using namespace std;
int Max_count(const vector<int> &a )
{
int result = 0;
for (int i = 0; i < a.size();++i )
if (a[i] == *max_element(a.begin(), a.end()))
result ++;
return result;
}
int main()
{
int n;
cin >> n;
vector<int> a(n);
for (int i = 0; i < n; ++i)
cin >> a[i];
cout << Max_count(a);
}