#include <stdio.h>

//Exo1

void affichage(int n, char** tab){
  int i=0;

  for ( ; i < n ; i++) {
    printf ("%s ", tab[i]);
  }
}

//exo 2

void echange_mot(int i, int j, char** tab){
  char* temp = tab[i];
  tab[i] = tab[j];
  tab[j] = temp;
}

//exo 3

 void  echange_lettre(int i, int j, char* tab[]){
  char temp;
  temp = tab[i][0];
  tab[i][0] = tab[j][0];
  tab[j][0] = temp;
}


int main (int argc, char** argv) {
  char* t[3]={"salut","bonjour","hello"};
  affichage(3,t);
  printf("\n");
  echange_mot (0, 2, t);
  affichage(3, t);
  echange_lettre (0, 1, t);
  printf("\n");

  affichage(3,t);
  return (0);
}

