Код: Выделить всё
int main() {
int size;
cout > size;
std::vector numbers(size);
string binaryIn;
//region of interest
cout > numbers[i];
if (numbers[i] == 0 || numbers[i] == 1)
binaryIn += std::to_string(numbers[i]);
else
cout = 4) {
string binaryNum = binaryIn.substr(binaryIn.length() - 4);
// Refer to table of binary to hex digits
if (binaryNum == "0000")
cout
Подробнее здесь: [url]https://stackoverflow.com/questions/79004405/how-do-i-get-my-program-to-accept-only-zeros-for-part-of-a-string-and-then-zeros[/url]