#include <iostream>
#include <string>
#include <sstream>
float to_float(const std::string& str)
{
std::istringstream is(str) ;
float result ;
is >> result ;
return result ;
}
int main()
{
std::string input ;
std::cout << "Enter a number\n" ;
std::cin >> input ;
float value = to_float(input) ;
std::cout << "value is " << value << '\n' ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgojaW5jbHVkZSA8c3N0cmVhbT4KCmZsb2F0IHRvX2Zsb2F0KGNvbnN0IHN0ZDo6c3RyaW5nJiBzdHIpCnsKICAgc3RkOjppc3RyaW5nc3RyZWFtIGlzKHN0cikgOwogICBmbG9hdCByZXN1bHQgOwogICAKICAgaXMgPj4gcmVzdWx0IDsKICAgcmV0dXJuIHJlc3VsdCA7Cn0KCmludCBtYWluKCkKewogICAgc3RkOjpzdHJpbmcgaW5wdXQgOwogICAgc3RkOjpjb3V0IDw8ICJFbnRlciBhIG51bWJlclxuIiA7CiAgICBzdGQ6OmNpbiA+PiBpbnB1dCA7CgogICAgZmxvYXQgdmFsdWUgPSB0b19mbG9hdChpbnB1dCkgOwogICAgc3RkOjpjb3V0IDw8ICJ2YWx1ZSBpcyAiIDw8IHZhbHVlIDw8ICdcbicgOwp9