#include <iostream>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

bool isNumber(const string& s) {
    long double t;
    istringstream r(s);

    return r >> t >> ws && r.eof();
}

int main() {
  std::vector<string> test{
    "3", "-3", // ints
      "1 3", " 13", " 1 3 ", "13 ", // weird spacing
      "0.1", "-100.123123", "1000.12312", // fixed point
      "1e5", "1e-5", "1.5e-10", "1a.512e4", // floating point
      "a", "1a", "baaa", "1a", // invalid
      "1e--5", "1e-", //invalid
      };

  for (auto t : test) {
    cout.width(20); cout << t << " " << isNumber(t) << endl;
  }
}