3<14 - истина
3<5 - истина
истина & истина = истина
Значением выражения будет являться истина.
Ответ: истина
[3.37]
49₁₀ = 61₈ = 110 001₂
53₁₀ = 65₈ = 110 101₂
64₁₀ = 100₈ = 1 000 000₂
150₁₀ = 226₈ = 10 010 110₂
266₁₀ = 412₈ = 100 001 010₂
[3.39]
29₁₀ = 1D₁₆ = 1 1101₂= 11 101₂ = 35₈
43₁₀ = 2B₁₆ = 10 1011₂ = 101 011₂ = 53₈
54₁₀ = 36₁₆ = 11 0110₂ = 110 110₂ = 66₈
120₁₀ = 78₁₆ = 111 1000₂ = 1 111 000₂ = 170₈
206₁₀ = CE₁₆ = 1100 1110₂ = 11 001 110₂ = 316₈
Точно также, как с тем словом. Каждый символ - это 1 байт.
В битах - умножаешь 500 на 8.
#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;
}
1.23 МБ - 1047 ( Но это не точно)
2.4 - 2048 байт, 4096 бит.
1.9 - 1970176