Announcement

Collapse
No announcement yet.

Infraction for 12520250: Tạo thread thiếu chất lượng

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Infraction for 12520250: Tạo thread thiếu chất lượng

    Post: help bt dslk don
    User: 12520250
    Infraction: Tạo thread thiếu chất lượng
    Points: 1

    Administrative Note:
    Đọc kỹ trước khi post bài: http://forum.uit.edu.vn/threads/26761-Phai-doc-truoc-khi-tao-thread-Mot-so-quy-tac-khi-hoi-cac-van-de-ve-lap-trinh-

    Message to User:
    Đọc kỹ trước khi post bài: http://forum.uit.edu.vn/threads/2676...-ve-lap-trinh-

    Original Post:
    mong các pro chỉ giúp từng dòng lệnh trong code dưới với . copy trên mạng mà không hiểu. mong mọi ng chú thích jup tung dong lệnh vs . tks .


    #include<conio.h>
    #include<stdio.h>
    #include<ctype.h>
    struct node
    {
    int data;
    node *next;
    };
    struct list
    {
    node *head;
    node *tail;
    };

    node *getnode(int x)
    {
    node *p;
    p=new(node);
    if(p==NULL)
    {
    printf("\n khong du bo nho");
    return NULL;
    }
    p->data=x;
    p->next=NULL;
    return p;

    }
    void Init(list &l)
    {
    l.head=l.tail=NULL;
    }
    void addtail(list &l,node *new_e)
    {
    if(l.head==NULL)
    {
    l.head=l.tail=new_e;
    }
    else
    {
    l.tail->next=new_e;
    l.tail=new_e;
    }
    }
    void nhap(list &l)
    {
    int i,n,x;
    node *p;
    printf("\n nhap so luong phan tu vao:");
    scanf("%d",&n);
    for(i=1;i<=n;i++)
    {
    printf("\n a[%d]= ",i);
    scanf("%d",&x);
    p=getnode(x);
    addtail(l,p);
    }
    }
    void xuat(list &l)
    {
    node *p;
    p=l.head;
    while(p!=NULL)
    {

LHQC

Collapse
Working...
X