a-conjecture-of-mine

An exercise on polyglossy: the same problem solved on multiple languages

commit 17209f51d5e5f856de15c37c897253377ff3d5ae
parent 293551db3313a6afac9588b1e56343ec0ebce3a4
Author: Pablo Escobar Gaviria <gark.garcia@protonmail.com>
Date:   Fri, 27 Dec 2019 08:18:28 -0200

Cleaned the C++ implementation.

Diffstat:
M.gitignore | 3++-
MC++/main.cpp | 24++++++++----------------
2 files changed, 10 insertions(+), 17 deletions(-)
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