Skip to content
Snippets Groups Projects
Commit bb389f5b authored by Sandipan Mohanty's avatar Sandipan Mohanty
Browse files

Formatting changes in gcd_w_concepts

parent 66d44a64
Branches
No related tags found
No related merge requests found
#include <type_traits>
#include <iostream> #include <iostream>
#include <type_traits>
template <class T> template <class T>
concept Integral = std::is_integral_v<T>; concept Integral = std::is_integral_v<T>;
constexpr auto gcd(Integral auto a, Integral auto b) { constexpr auto gcd(Integral auto a, Integral auto b)
if (b == 0) return a; {
else return gcd(b, a % b); if (b == 0)
return a;
return gcd(b, a % b);
} }
auto main() -> int auto main() -> int
{ {
...@@ -14,4 +16,3 @@ auto main() -> int ...@@ -14,4 +16,3 @@ auto main() -> int
// are changed into integral types. // are changed into integral types.
std::cout << gcd(149935, 47295.) << "\n"; std::cout << gcd(149935, 47295.) << "\n";
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment