32 lines
768 B
C#
Raw Normal View History

2022-09-08 08:53:24 +02:00
using System;
namespace Programmation_objet_TLESIO21.TD1 {
public static class Td1 {
private static void Excercice1(ref int a, ref int b) {
(a, b) = (b, a);
}
private static void TestExcercice1() {
Console.Write("Saisir a : ");
String s = Console.ReadLine();
int a = int.Parse(s);
Console.Write("Saisir b : ");
s = Console.ReadLine();
int b = int.Parse(s);
Console.WriteLine("Avant inversion, a = " + a + " & b = " + b);
Excercice1(ref a, ref b);
Console.WriteLine("Après inversion, a = " + a + " & b = " + b);
}
public static void Launch() {
TestExcercice1();
}
}
}