#include#include #include #include #include using namespace std;bool valid(string str){ const regex pattern("[0-9a-fA-F]{2} [0-9a-fA-F]{2} [0-9a-fA-F]{2} [0-9a-fA-F]{2}"); return regex_match(str,pattern);}bool parse(string str,float &f){ uint32_t num; for(string::iterator itr=str.begin();itr!=str.end();itr++) { if(*itr==' '){ str.erase(itr); } } str="0x"+str; sscanf(str.c_str(),"%x",&num); f=*((float*)&num); cout< < ::is_iec559, "必须输入符合的浮点数" ) ; union { float fval ; std::uint32_t ival ; }; fval = f ; std::ostringstream stm ; stm << std::hex << std::uppercase << ival< int; *"< float; *"< >select; switch(select) { case 0: std::cout<<"请输入数字 (int 四位输入时隔空格,由低位字节向高位字节排序"< >f; cout<