Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace f6._
- {
- class Program
- {
- public static void Main(string[] args)
- {
- /* Programme insérant V à un indice I et qui décale vers la droite (en direction des indices montant) les valeurs. La dernière valeur est perdue */
- int[] tabEntier = { 14, 28, 32, 16, 14, 15, 8, 9, 7, 6, 48, 20, 1, 0, 91, 15 };
- Console.WriteLine("V ?");
- int V = int.Parse(Console.ReadLine());
- Console.WriteLine("I ?");
- int I = int.Parse(Console.ReadLine());
- int[] tabTemp = { 14, 28, 32, 16, 14, 15, 8, 9, 7, 6, 48, 20, 1, 0, 91, 15 };
- for(int j = I; j > 0 ; j--){
- tabEntier[j - 1] = tabTemp[j];
- }
- tabEntier[I] = V;
- foreach(int a in tabEntier){
- Console.WriteLine(a);
- }
- Console.ReadKey(true);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement