1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47
| # include <stdio.h>
# include <stdlib.h>
typedef struct noeud
{
int coef;
int deg;
struct noeud *suiv ;
}NOEUD;
typedef NOEUD *list;
list tri(list p,int a)
{
list l;
l=p;
int main()
{ list p,l;
int x,y,i=1;
l==NULL;
printf("tapez le coefficient : ");
scanf("%d",&x);
printf("tapez le degre : ");
scanf("%d",&y);
p = ( NOEUD *) malloc ( sizeof(NOEUD)) ;
p->coef = x;
p->deg = y;
p->suiv = l;
l=p;
while (x!=0)
{
p = ( NOEUD *) malloc ( sizeof(NOEUD)) ;
p->coef = x;
p->deg = y;
p->suiv = l;
l=p;
printf("tapez le coefficient : ");
scanf("%d",&x);
printf("tapez le degre : ");
scanf("%d",&y);
i++;
}
getch();
return 0;
} |
Partager