static void Main(string[] args) { Console.WriteLine("Введите число а: "); int a = Convert.ToInt32(Console.ReadLine()); Console.WriteLine("Введите число b: "); int b = Convert.ToInt32(Console.ReadLine()); MyVariables.Swap(ref a, ref b); Console.WriteLine($"Число а = {a}, число b = {b}"); }
public void Swap(int a, int b) { int temp1 = a; int temp2 = b; MyVariables.Swap(ref a, ref b); if (a == temp2 && b == temp1) { Assert.Pass(); } else { Assert.Fail(); } }