#include <iostream>
#include <ctime>
using namespace std;
void FillArray( int *mainArray, int arraySize,
int leftRandBorder, int rightRandBorder )
{
srand(time(NULL));
for (int i = 0; i < arraySize; i++)
mainArray[i] = leftRandBorder + rand() % (rightRandBorder - leftRandBorder + 1);
}
int SearchArray( int *mainArray, int arraySize, int number_A, int number_B )
{
int res = 0;
for (int i = 0; i < arraySize; i++)
res += mainArray[i] >= number_A && mainArray[i] <= number_B;
return res;
}
int main()
{
int
*mainArray,
arraySize;
cout << "Enter the array size: ";
cin >> arraySize;
mainArray = new int[arraySize];
int
leftRandBorder,
rightRandBorder;
cout << "Enter the rage from 'a' to 'b': ";
cin >> leftRandBorder >> rightRandBorder;
FillArray(mainArray, arraySize, leftRandBorder, rightRandBorder);
int
number_A,
number_B;
cout << "Enter the 'number_A' and the 'number_B': ";
cin >> number_A >> number_B;
cout << "Result =
<< SearchArray(mainArray, arraySize, number_A, number_B)
<< endl;
delete[] mainArray;
cout << "\nPress 'Enter' for exit\n";
cin.get();
return 0;
}
Ответ:
import itertools
import re
lines = []
with open("input.txt", "r") as f:
line = f.read()
for string in line.split('\n'):
if len(string) > 1:
a = [item for item in re.compile('\d+').findall(string)]
a = len(set(a))
lines.append(a)
with open(r"output.txt", "w") as file:
for line in lines:
file.write(str(line) + '\n')
Объяснение:
Python 3.7
<span><span>техническое средство, с помощью которого происходит передача информаци-</span>телевидение</span>
Y = X - 1 (1)
X = 2 + Y (2)
Y = X + Y (3)
Из (2) и (3) следует, что
10 = (2 + Y) + Y ⇒ Y = 4 (после выполнения команды 1)
X = 6 (после выполнения команды 2)
Значит, до работы алгоритма X = 5
Проверка:
X = 5
Y = X-1 = 5-1 = 4
X = 2+Y = 2+4 = 6
Y = X+Y = 6+4 = 10
1. 0,25 Кбайт=256 байт = 2048 бит
2. Каждый символ - 8 бит
3. 2048/8=256 символов