Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Least-common-multiple/C-sharp/least-common-multiple.cs
Normal file
16
Task/Least-common-multiple/C-sharp/least-common-multiple.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
Using System;
|
||||
class Program
|
||||
{
|
||||
static int gcd(int m, int n)
|
||||
{
|
||||
return n == 0 ? Math.Abs(m) : gcd(n, n % m);
|
||||
}
|
||||
static int lcm(int m, int n)
|
||||
{
|
||||
return Math.Abs(m * n) / gcd(m, n);
|
||||
}
|
||||
static void Main()
|
||||
{
|
||||
Console.WriteLine("lcm(12,18)=" + lcm(12,18));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue