fork(9) download
#include <algorithm>
#include <cassert>
#include <cctype>
#include <string>
 
bool is_number(const std::string &s) {
  return !s.empty() && std::all_of(s.begin(), s.end(), ::isdigit);
}
 
int main() {
  assert(!is_number(""));
  assert(is_number("123"));
  assert(!is_number("123abc"));
}
Success #stdin #stdout 0s 3468KB
stdin
Standard input is empty
stdout

Standard output is empty