0) reminder = Mod(n, m); n = m; m = reminder; Console.WriteLine("The GCD is: " + n); התוכנית: 15,4"> 0) reminder = Mod(n, m); n = m; m = reminder; Console.WriteLine("The GCD is: " + n); התוכנית: 15,4">

Presentation is loading. Please wait.

Presentation is loading. Please wait.

התוכנית: using System; using System.Collections.Generic;

Similar presentations


Presentation on theme: "התוכנית: using System; using System.Collections.Generic;"— Presentation transcript:

1 התוכנית: 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); התוכנית:

2 התוכנית: 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); התוכנית: 15,4

3 התוכנית: 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); התוכנית: Mod??!?

4 התוכנית: 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); התוכנית: 15,4

5 התוכנית: 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); התוכנית:

6 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; }

7 static int Mod(int x, int y)
{ while (x>=y) x=x-y; return x; }

8 static int Mod(int x, int y)
{ while (x>=y) x=x-y; return x; }

9 התוכנית: 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); התוכנית:

10 התוכנית: 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); התוכנית:

11 התוכנית: 3 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


Download ppt "התוכנית: using System; using System.Collections.Generic;"

Similar presentations


Ads by Google