Corriger mes erreurs(langage C)
lhousain
-
Dalfab Messages postés 720 Statut Membre -
Dalfab Messages postés 720 Statut Membre -
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<conio.h>
typedef char donnee[20];
typedef struct noeudl {
donnee mot;
struct noeudl * suivant;
}noued;
noued * creer_liste()
{
noued * p;
p=NULL;
return p;
}
// la fonction d'insertion au debut de la liste chainees.
void inserer_tete(noeud ** pp,donnee x)
{
noeud * p;
p=(noeud *)malloc(sizeof(noeud));
strcpy(p->mot,x);
p->suivant=*pp;
return;
}
//la fonction d'inserer a la fin de la liste chainees.
void inserer_fin(noeud ** l,donnee x)
{
noeud * p,*parc;
parc=*l;
p=(noeud *)malloc(sizof(noeud));
strcpy(p->mot,x);
p->suivant=NULL;
if(*l==NULL)
else
{
while(parc->suivant!=NULL)
{
parc=parc->suivant;
}
parc->suivant=p;
}}
void afficheage(noeud * l)
{
noeud * p;
p=l;
while(p!=NULL)
{
printf("%s\t",p->mot);
p=p->suivant;
}
}
INT MAIN()
{
int ch{20];
noeud * l=creer_liste();
noeud * l_invr=creer_list();
char var[10];
char arret[10]="stop";
printf("but de programme:\n");
printf("est de construire une phrase par les listes chainees\n");
printf("taper un mot ou une phrase ou un texte,si vous voulez sortir taper //stop//\n");
scanf("%s",var);
getchar();
while(strcmp(var,arret))
{
inserer_fin(&l,var);
inserer_tete(&l_inver,var);
printf("SVP entrer un mot ou une phrase\");
scanf("%s",var);
getchar();
}
printf("***********c'est le sens correct de la phrase***********\n");
AFFICHAGE(l);
printf("*********la phrase dans le sens inverse**********\n");
AFFICHAGE(l_inver);
getch();
return 0;
}
#include<stdlib.h>
#include<string.h>
#include<conio.h>
typedef char donnee[20];
typedef struct noeudl {
donnee mot;
struct noeudl * suivant;
}noued;
noued * creer_liste()
{
noued * p;
p=NULL;
return p;
}
// la fonction d'insertion au debut de la liste chainees.
void inserer_tete(noeud ** pp,donnee x)
{
noeud * p;
p=(noeud *)malloc(sizeof(noeud));
strcpy(p->mot,x);
p->suivant=*pp;
- pp=p;
return;
}
//la fonction d'inserer a la fin de la liste chainees.
void inserer_fin(noeud ** l,donnee x)
{
noeud * p,*parc;
parc=*l;
p=(noeud *)malloc(sizof(noeud));
strcpy(p->mot,x);
p->suivant=NULL;
if(*l==NULL)
- l=p;
else
{
while(parc->suivant!=NULL)
{
parc=parc->suivant;
}
parc->suivant=p;
}}
void afficheage(noeud * l)
{
noeud * p;
p=l;
while(p!=NULL)
{
printf("%s\t",p->mot);
p=p->suivant;
}
}
INT MAIN()
{
int ch{20];
noeud * l=creer_liste();
noeud * l_invr=creer_list();
char var[10];
char arret[10]="stop";
printf("but de programme:\n");
printf("est de construire une phrase par les listes chainees\n");
printf("taper un mot ou une phrase ou un texte,si vous voulez sortir taper //stop//\n");
scanf("%s",var);
getchar();
while(strcmp(var,arret))
{
inserer_fin(&l,var);
inserer_tete(&l_inver,var);
printf("SVP entrer un mot ou une phrase\");
scanf("%s",var);
getchar();
}
printf("***********c'est le sens correct de la phrase***********\n");
AFFICHAGE(l);
printf("*********la phrase dans le sens inverse**********\n");
AFFICHAGE(l_inver);
getch();
return 0;
}
A voir également:
- Corriger mes erreurs(langage C)
- Langage ascii - Guide
- Langage binaire - Guide
- Corriger un message whatsapp - Guide
- Langage visual basic - Télécharger - Langages
- Pascal langage - Télécharger - Édition & Programmation
Peux tu me verifier le syntaxe.