restruct folders and base approach
This commit is contained in:
18
src/tmp/numbers/gcd.hpp
Normal file
18
src/tmp/numbers/gcd.hpp
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
// Называется алгоритм Евклида
|
||||
// Находит наибольший общий делитель
|
||||
namespace alg
|
||||
{
|
||||
inline int gcd(int a, int b)
|
||||
{
|
||||
while (b != 0)
|
||||
{
|
||||
int r = a%b;
|
||||
a = b;
|
||||
b = r;
|
||||
}
|
||||
|
||||
return a;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user