#include <iostream>
#include <string>
#include <cctype>
#include <fstream>
#include <locale>
#include <algorithm>
class my_ctype : public std::ctype<char> {
mask my_table[table_size];
public:
my_ctype(size_t refs = 0) : std::ctype<char>(my_table, false, refs) {
std::copy_n(classic_table(), table_size, my_table);
my_table[static_cast<unsigned char>(',')] |= space; // Добавляем символ '^' как пробельный
}
};
int main(){
if(std::ifstream in("input.txt"); in.is_open()){
//read first line
{
std::string str;
getline(in, str);
std::cout << str << std::endl;
}
// set locale with custom facet and set number format read
in.imbue(std::locale(std::cin.getloc(), new my_ctype()));
in >> std::hex;
// reads values
unsigned value;
while(in >> value)
std::cout << value << std::endl;
}else{
std::cout << "File not opened." << std::endl;
}
}
first line
0x0f, 0xff
0x100009,
0xffffffff,