Advertisement
Guest User

ukolini vece

a guest
Jan 20th, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.71 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3.  
  4. struct lista {
  5. int i;
  6. struct lista *next;
  7. };
  8. void UkloniVece(struct lista *);
  9. void print_lista(struct lista *);
  10.  
  11. void main(){
  12. struct lista *p,*q,*t;
  13. int n;
  14. p=(struct lista *)malloc(sizeof(struct lista));
  15. p->next=NULL;
  16. scanf("%d",&n);
  17. p->i=n;
  18. t=p;
  19. while(n<30){
  20.     q=(struct lista *)malloc(sizeof(struct lista));
  21.     scanf("%d",&n);
  22.     q->next=NULL;
  23.     q->i=n;
  24.     t->next=q;
  25.     t=q;
  26.     }
  27.     print_lista(p);
  28.  
  29.     /**/
  30.  
  31. }
  32.  
  33. void print_lista(struct lista *p){
  34. struct lista *q=p;
  35. while(q!=NULL){
  36.     printf("%d ",q->i);
  37.     q=q->next;
  38.     }
  39.  
  40. }
  41. void UkloniVece(struct lista *gl);
  42. struct lista *p,*pom;
  43. int i,a,m;
  44. p=gl;
  45. i=1;
  46. a=p->i;
  47. while(p!=NULL){
  48.     if(a<p->i){
  49.         m=i;
  50.  
  51.  
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement