42 lines
1.1 KiB
C#
42 lines
1.1 KiB
C#
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);
|
|
}
|
|
|
|
private static void Excercice2() {
|
|
Console.WriteLine("Veuillez saisir un texte : ");
|
|
String s = Console.ReadLine();
|
|
Console.WriteLine("Vous avez saisi : «" + s + "»");
|
|
}
|
|
|
|
private static void TestExcercice2() {
|
|
Excercice2();
|
|
}
|
|
|
|
public static void Launch() {
|
|
TestExcercice2();
|
|
}
|
|
|
|
|
|
}
|
|
}
|