fork(1) download
  1. #include <string>
  2. #include <stdexcept>
  3. #include <iostream>
  4. int N_size_file = 5000;
  5. int N_MAX = 4500;
  6. void f()
  7. {
  8. if(N_size_file > N_MAX)
  9. throw std::runtime_error( "check(): Hidden node count of "
  10. + std::to_string(N_size_file)
  11. + " exceeds maximum allowed value of "
  12. + std::to_string(N_MAX));
  13. }
  14. int main()
  15. {
  16. try {
  17. f();
  18. } catch(const std::exception& e) {
  19. std::cout << "Caught exception: " << e.what() << '\n';
  20. }
  21. }
Success #stdin #stdout 0s 2964KB
stdin
Standard input is empty
stdout
Caught exception: check(): Hidden node count of 5000 exceeds maximum allowed value of 4500