Commit 4b7ce3d1 by Tobias Langer

Minor optimization of the summation algorithm.

parent a4c6f3e6
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
int sum(int n) int sum(int n)
{ {
return ((n + 1) * n) / 2; return ((n - 1) * n) / 2;
} }
void usage(const char* app_name, const char* err_string) void usage(const char* app_name, const char* err_string)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment