1 / 11

using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 {

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

mccarterd
Download Presentation

using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication1 {

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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

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

More Related