110 likes | 140 Views
using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static int Mod(int x, int y) { while (x >= y) x = x - y; return x; }
E N D
using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static int Mod(int x, int y) { while (x >= y) x = x - y; return x; } static void Main(string[] args) { int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) { reminder = Mod(n, m); n = m; m = reminder; } Console.WriteLine("The GCD is: " + n); } } } התוכנית:
using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static int Mod(int x, int y) { while (x >= y) x = x - y; return x; } static void Main(string[] args) { int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) { reminder = Mod(n, m); n = m; m = reminder; } Console.WriteLine("The GCD is: " + n); } } } 15,4 התוכנית:
using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static int Mod(int x, int y) { while (x >= y) x = x - y; return x; } static void Main(string[] args) { int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) { reminder = Mod(n, m); n = m; m = reminder; } Console.WriteLine("The GCD is: " + n); } } } Mod??!? התוכנית:
using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static int Mod(int x, int y) { while (x >= y) x = x - y; return x; } static void Main(string[] args) { int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) { reminder = Mod(n, m); n = m; m = reminder; } Console.WriteLine("The GCD is: " + n); } } } 15,4 התוכנית:
using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static int Mod(int x, int y) { while (x >= y) x = x - y; return x; } static void Main(string[] args) { int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) { reminder = Mod(n, m); n = m; m = reminder; } Console.WriteLine("The GCD is: " + n); } } } התוכנית:
הפעולה: static int Mod(int x, int y) { while (x>=y) x=x-y; return x; }
static int Mod(int x, int y) { while (x>=y) x=x-y; return x; }
static int Mod(int x, int y) { while (x>=y) x=x-y; return x; }
using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static int Mod(int x, int y) { while (x >= y) x = x - y; return x; } static void Main(string[] args) { int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) { reminder = Mod(n, m); n = m; m = reminder; } Console.WriteLine("The GCD is: " + n); } } } התוכנית:
using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static int Mod(int x, int y) { while (x >= y) x = x - y; return x; } static void Main(string[] args) { int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) { reminder = Mod(n, m); n = m; m = reminder; } Console.WriteLine("The GCD is: " + n); } } } התוכנית:
using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 { class Program { static int Mod(int x, int y) { while (x >= y) x = x - y; return x; } static void Main(string[] args) { int n, m, reminder; Console.WriteLine("Enter two numbers"); n = int.Parse(Console.ReadLine()); m = int.Parse(Console.ReadLine()); while (m > 0) { reminder = Mod(n, m); n = m; m = reminder; } Console.WriteLine("The GCD is: " + n); } } } 3 התוכנית: