#include <iostream>
#include <sstream>
#include <string>
using namespace std;
int main() {
istringstream iss("2.832 1.3067 nana1.678 xxx.05 meh.ugh");
double num = 0;
while(iss >> num || !iss.eof()) {
if(iss.fail()) {
iss.clear();
while(iss) {
char dummy = iss.peek();
if(std::isdigit(dummy) || dummy == '.') {
// Stop consuming invalid double characters
break;
}
else {
iss >> dummy; // Consume invalid double characters
}
}
continue;
}
cout << num << endl;
}
return 0;
}
CSNpbmNsdWRlIDxpb3N0cmVhbT4KCSNpbmNsdWRlIDxzc3RyZWFtPgoJI2luY2x1ZGUgPHN0cmluZz4KCXVzaW5nIG5hbWVzcGFjZSBzdGQ7CgkKCWludCBtYWluKCkgewoJCgkJaXN0cmluZ3N0cmVhbSBpc3MoIjIuODMyIDEuMzA2NyBuYW5hMS42NzggeHh4LjA1IG1laC51Z2giKTsKCQlkb3VibGUgbnVtID0gMDsKCQl3aGlsZShpc3MgPj4gbnVtIHx8ICFpc3MuZW9mKCkpIHsKCQkJaWYoaXNzLmZhaWwoKSkgewoJCQkJaXNzLmNsZWFyKCk7CgkJCQl3aGlsZShpc3MpIHsKCQkJCQljaGFyIGR1bW15ID0gaXNzLnBlZWsoKTsKCQkJCQlpZihzdGQ6OmlzZGlnaXQoZHVtbXkpIHx8IGR1bW15ID09ICcuJykgewoJCQkJCQkvLyBTdG9wIGNvbnN1bWluZyBpbnZhbGlkIGRvdWJsZSBjaGFyYWN0ZXJzCgkJCQkJCWJyZWFrOwoJCQkJCX0KCQkJCQllbHNlIHsKCQkJCQkgICAgaXNzID4+IGR1bW15OyAvLyBDb25zdW1lIGludmFsaWQgZG91YmxlIGNoYXJhY3RlcnMKCQkJCQl9CgkJCQl9CgkJCQljb250aW51ZTsKCQkJfQoJCQljb3V0IDw8IG51bSA8PCBlbmRsOwoJCX0KCQlyZXR1cm4gMDsKCX0=