#include <iostream>
#include <vector>
#include <math.h>
using namespace std;
int main()
{
vector<double> tvec;
tvec.push_back(2.1);
tvec.push_back(3.2);
tvec.push_back(4.3);
tvec.push_back(NAN);
tvec.push_back(4.5);
tvec.push_back(3.6);
for(const double& dv : tvec)
{
if (isnan(dv))
cout << "This is not a number" << endl;
else
cout << dv << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8bWF0aC5oPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCkKewoJdmVjdG9yPGRvdWJsZT4gdHZlYzsKCQoJdHZlYy5wdXNoX2JhY2soMi4xKTsKCXR2ZWMucHVzaF9iYWNrKDMuMik7Cgl0dmVjLnB1c2hfYmFjayg0LjMpOwoJdHZlYy5wdXNoX2JhY2soTkFOKTsKCXR2ZWMucHVzaF9iYWNrKDQuNSk7Cgl0dmVjLnB1c2hfYmFjaygzLjYpOwoKCWZvcihjb25zdCBkb3VibGUmIGR2IDogdHZlYykKCXsKCQlpZiAoaXNuYW4oZHYpKQoJCQljb3V0IDw8ICJUaGlzIGlzIG5vdCBhIG51bWJlciIgPDwgZW5kbDsKCQllbHNlCgkJCWNvdXQgPDwgZHYgPDwgZW5kbDsKCX0KCglyZXR1cm4gMDsKfQ==