예제 #1
0
파일: test_liste.c 프로젝트: BriceSD/APL3
void test_repeter_elements_param (liste L)
{
  printf ("répéter_éléments (") ;
  afficher_liste (L) ;
  printf (") = ") ;
  afficher_liste (repeter_elements (L)) ;
  printf ("\n") ;
}
예제 #2
0
파일: test_liste.c 프로젝트: BriceSD/APL3
void test_inserer_liste_D_param (unsigned int n, int x, liste L)
{
  printf ("Insertion de %i à la position %u de la liste ",
	  x, n) ;
  afficher_liste (L) ;
  printf("\nRésultat : ") ;
  L = inserer_liste_D (n, x, L) ;
  afficher_liste (L) ;
  printf("\n") ;
}
예제 #3
0
파일: test_liste.c 프로젝트: BriceSD/APL3
void test_repeter_elements_D ()
{
  liste L ;
  L = cons (1, cons (2, cons (3, l_vide ()))) ;
  printf ("Avant : L = ") ;
  afficher_liste (L) ;
  repeter_elements_D (L) ;
  printf ("\nAprès : L = ") ;
  afficher_liste (L) ;
  printf ("\n") ;
}
예제 #4
0
파일: test_liste.c 프로젝트: BriceSD/APL3
void test_longueur ()
{
  liste L ;
  L = liste_test1 () ;
  printf ("Longueur de ") ;
  afficher_liste (L) ;
  printf (" = %d (R) = %d (I)\n",
	  longueurR (L), longueurI (L)) ;
}
예제 #5
0
파일: td2_3.c 프로젝트: garry7/IN301
void afficher_liste(liste l)
{
	if(vide(l)) printf(" \n ");
	
	else
	{
		printf(" %d ", l->val);
		afficher_liste(l->suiv);
	}
}
예제 #6
0
파일: main.c 프로젝트: slydevis/Polytech
int main(void)
{
    int choix ;
    int nb ;
    

    Liste ma_liste ;

    init(); // initialisations (des structures de donnees utilisees pour la
            // gestion de la memoire) 
    ma_liste = creer_liste_vide() ; 
    menu();    
    choix = lire_entier() ;
    while (choix != 0)
    {
        switch(choix)
        {
            case 1 : 
                   ma_liste = creer_liste_vide() ; 
                   break;
            case 2 : 
                   afficher_chaine("nombre a inserer ? ");
                   nb = lire_entier();
                   ma_liste = inserer_tete(ma_liste, nb);
                   break ;
            case 3 : 
                   afficher_chaine("nombre a rechercher ? ");
                   nb = lire_entier();
                   if(rechercher(ma_liste, nb) !=0)
                        afficher_chaine (" present!\n");
                   else 
                        afficher_chaine(" absent!\n");
                   break;
            case 4 : 
                   afficher_liste(ma_liste);
                   break ;
            case 5:
                   afficher_liste_inverse(ma_liste);
                   break ;
            case 6: ma_liste = supprimer_tete(ma_liste); 
                   break ;
            case 7: ma_liste = supprimer_queue(ma_liste);
                   break ;
         }
         menu();
         choix = lire_entier() ;
    }

    


return(0);
}
예제 #7
0
int main(void){
    t_case grille[N][N];
    t_score Liste[1000];
    int tailleListe;
    generation(grille);
    printf("\n\n\t  RUZZLE SOLVER\n");
    afficher_matrice(grille);
    points = trouverListe(grille);
    tri(Liste, &tailleListe);
    printf("Voici la liste des mots trouve dans la grille et leur nombre de points :\n");
    afficher_liste(tailleListe, Liste);
void test(void){ 
	CU_ASSERT_EQUAL(points, 21); 
}
예제 #8
0
파일: td2_3.c 프로젝트: garry7/IN301
int main()
{
	
	srand(time(NULL));
	liste l = initialiser();
	//vide(l);
	//afficher_liste(l);
	l = ajoutdebut(l,10);
	l = ajoutfin(l,15);
	l = ajouttrie(l,13);
	afficher_liste(l);
	testajout();
	return 0;
}
예제 #9
0
파일: td2_3.c 프로젝트: garry7/IN301
void testajout()
{
	int a;
	
	liste l1 = initialiser();
	/*liste l2 = initialiser();
	liste l3 = initialiser();*/
	
	do
	{
		a = alea(10);
		l1 = ajoutdebut(l1,a);
		/*l2 = ajoutfin(l2,a);
		l3 = ajouttrie(l3,a);*/
	} while (a != 0);
	
	afficher_liste(l1);
	//afficher_liste(l2);
	//afficher_liste(l3);
}