public class GcdCalculator1 { public static int Gcd (int p, int q) { int r; p = System.Math.Abs(p); q = System.Math.Abs(q); while (q > 0) { r = p % q; p = q; q = r; } return p; } protected const string Hint = "Please call the gcd calculator with two integer arguments!"; public static void Main (string[] args) { if (args.Length < 2) { System.Console.WriteLine("Missing Argument. " + Hint); } else { try { System.Console.WriteLine (Gcd (System.Convert.ToInt32(args[0]), System.Convert.ToInt32(args[1]))); } catch (System.Exception e) { System.Console.WriteLine("Wrong Argument. " + Hint); } } } }