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">
Download presentation
Presentation is loading. Please wait.
Published byJeffrey Lindsey Modified over 6 years ago
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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.