帮我看看这乱78糟的代码!(新手)
程序代码:
#include"stdio.h" #define NULL 0 main() { struct student { char *name; int num; int tel; struct student *next; }; int c; struct student a,b,*head,*p; a.name="qqq",a.num=17,a.tel=61334; b.name="sss",b.num=12,b.tel=654312; head=&a;a.next=&b;b.next=NULL,p=head; printf("please intput student num\n"); scanf("%d",&c); while(p->num!=c&&p->next!=NULL) {p=p->next;} printf("%c\t\t%d",p->name,p->tel); getch(); }我想实现的效果是,当我输入17,程序输出:qqq 61334
12 sss 654132
我知道我这东西有很多的错误,不规范,恳请大家狠狠地指出来!窝是自学的!