- Commit
- 17209f51d5e5f856de15c37c897253377ff3d5ae
- Parent
- 293551db3313a6afac9588b1e56343ec0ebce3a4
- Author
- Pablo Escobar Gaviria <gark.garcia@protonmail.com>
- Date
Cleaned the C++ implementation.
An exercise on polyglossy: the same problem solved on multiple languages
Cleaned the C++ implementation.
2 files changed, 10 insertions, 17 deletions
Status | File Name | N° Changes | Insertions | Deletions |
Modified | .gitignore | 3 | 2 | 1 |
Modified | C++/main.cpp | 24 | 8 | 16 |
diff --git a/.gitignore b/.gitignore @@ -1,11 +1,12 @@ .idea .vscode -*.exe *.img *.IMG +*.beam bin bin/ build Statistics Latex Q# +Cuda
diff --git a/C++/main.cpp b/C++/main.cpp @@ -38,21 +38,16 @@ void get_counterexpl_thread(unsigned int start, unsigned int max, unsigned int i bool read_first_arg(int argc, char *argv[], unsigned int *value) { - if (argc > 1) + try { std::string value_str = argv[1]; - - try - { - *value = std::stoul(value_str); - return true; - } - catch (...) - { - return false; - } + *value = std::stoul(value_str); + return true; + } + catch (...) + { + return false; } - else return false; } int main(int argc, char *argv[]) @@ -76,8 +71,5 @@ int main(int argc, char *argv[]) return SUCCESS; } - else - { - return INVALID_INPUT; - } + else return INVALID_INPUT; } \ No newline at end of file