öλÔÓéÀֵǼÈë¿ÚÏÂÔØ

Ë­°ïÎÒ¿´¿´£¬´íÔÚÄÄ£¿

Alex2009 Ãâ·ÑöλÔÓéÀÖ¹Ù·½appÏÂÔØÂÛ̳/2008-10-09

Ô­ÎÄÄÚÈÝÀ´×ÔÃâ·ÑöλÔÓéÀÖ¹Ù·½appÏÂÔØÂÛ̳£¬Çëµã»÷²é¿´È«ÎÄ
http://bbs.freekaoyan.com/viewthread.php?tid=323415
#include <stdio.h>
#include <malloc.h>
#define NULL 0
#define LEN sezeof(struct student)
struct student
{
long num;
float score;
struct student *next;
};
int n;
struct studnt * creat(void)
{
struct student *head;
struct student *p1,*p2;
n=0;
p1=p2=(struct student*)malloc(LEN);
scanf("%ld,%f",&p1->num,&p1->score);
head=NULL;
while(p1->num!=0)
{
n=n 1;
if(n==1)head=p1;
else p2->next=p1;
p2=p1;
p1=(struct student*)malloc(LEN);
scanf("%ld,%f",&p1->num,&p1->score);
}
p2->next=NULL;
return(head);
}
main()
{
creat();
}

ΪʲôÎÒÓÐTUBOR C ±à¼­µÄʱºò³öÏÖN¶à´íÎó°¡£¿

---------------------------------
1.ÄãµÄcreat();Óиö·µ»ØÖµ
2.TUBOR C¶¼ÌáʾÁËʲôÄãµÃ˵Çå³þѽ
3.ÔÚÖ÷º¯ÊýÖÐ×îºÃ°ÑÄ㽨µÄÁ´±íÓÃÒ»¸öwhileÑ­»·¸ø´òÓ¡³öÀ´£¬À´ÑéÖ¤ÄãµÄÁ´±í½¨µÄ¶Ô²»¶Ô
½¨ÒéÄãÔÚvc6.0ÊÔÊÔ
ÓÐʲôÎÊÌâÎÒÃÇÔÚ½»Á÷
---------------------------------
#include <stdio.h>
#include <malloc.h>
//#define NULL 0
#define LEN sizeof(struct student)

struct student
{
long num;
float score;
struct student *next;
};

struct student * creat()
{
struct student *head = NULL;
struct student *p1,*p2;
int n=0;
p1=p2=(struct student*)malloc(LEN);
int numb = 0;
float scor = 0.0;
scanf("%d,%f", &numb, &scor);
p1->num = numb;
p1->score = scor;

while(p1->num!=0)
{
n=n 1;
if(n==1) head = p1;
else p2->next = p1;
p2 = p1;
p1 = (struct student*)malloc(LEN);
scanf("%d,%f", &numb, &scor);
p1->num = numb;
p1->score = scor;
p1->next = NULL;
}
p2->next = p1;

return(head);
}

void output(struct student *head)
{
struct student *p1 = head;

while(p1!=NULL && p1->next!=NULL)
{
printf("%ld,%f\n", p1->num, p1->score);
p1 = p1->next;
}

printf("\nIt's the end!\n");
}

int main(int argc,char** argv)
{
struct student *head = creat();
output(head);

return 0;
}
---------------------------------
Õâ¸öÔÚVC6ÏÂͨ¹ý
---------------------------------
ºÇºÇ£¬Ð»Ð»ÄãÃÇÁ˰¡

---------------------------------
àÅ£¬Ð»Ð»À²

---------------------------------
Õâ¸ö³ÌÐòÊÇÎÒ´ÓÌ·ºÆÇ¿µÄCÓïÑÔ£¨µÚÈý°æ£©ÉϰãÏÂÀ´µÄ£¬½¨Á¢µ¥Á´±íÄÇÕ£¬¿ÉÊÇÎÒÔÚTUBOR CÉÏÓõÄʱºò±¨¸æ³ö´í

---------------------------------
ÊDz»ÊÇÒòΪTUBOR CºÍC 3.0ÔËÐл·¾³²»Í¬µ¼Öµİ¡£¿

---------------------------------
¸öÈ˶ÔÌ·µÄC²»ÊǺܿ´ºÃ
---------------------------------
±àÒëÆ÷²»Í¬£¬ÊµÏÖ²»Í¬

Ïà¹Ø»°Ìâ/

  • ÁìÏÞʱ´ó¶îÓÅ»Ýȯ,Ïí±¾Õ¾Õý°æöλÔÓéÀֵǼÈë¿ÚÏÂÔØöλÔÓéÀÖ¹Ù·½appÏÂÔØ!
    ´ó¶îÓÅ»Ýȯ
    ÓÅ»ÝȯÁìÈ¡ºó72СʱÄÚÓÐЧ£¬10ÍòÖÖ×îÐÂöλÔÓéÀֵǼÈë¿ÚÏÂÔØ¿¼Ö¤Ààµç×Ó´òÓ¡öλÔÓéÀÖ¹Ù·½appÏÂÔØÈÎÄãÑ¡¡£º­¸ÇÈ«¹ú500ÓàËùԺУöλÔÓéÀÖ¹Ù·½appÏÂÔØöλÔÓéÀֵǼÈë¿ÚÏÂÔØ¿Î¡¢200¶àÖÖÖ°Òµ×ʸñöλÔÓéÀֵǼÈë¿ÚÏÂÔØ¡¢1100¶àÖÖ¾­µä½Ì²Ä£¬²úÆ·ÀàÐͰüº¬µç×ÓÊé¡¢Ìâ¿â¡¢È«Ì×öλÔÓéÀÖ¹Ù·½appÏÂÔØÒÔ¼°ÊÓÆµ£¬ÎÞÂÛÄúÊÇöλÔÓéÀÖ¹Ù·½appÏÂÔØ¸´Ï°¡¢¿¼Ö¤Ë¢Ì⣬»¹ÊÇ¿¼Ç°³å´ÌµÈ£¬²»Í¬ÀàÐ͵IJúÆ·¿ÉÂú×ãÄúѧϰÉϵIJ»Í¬ÐèÇó¡£ ...
    öλÔÓéÀֵǼÈë¿ÚÏÂÔØÓÅ»Ýȯ ±¾Õ¾Ð¡±à FreeÒ¼°Û·ÖÑ§Ï°Íø 2022-09-19
öλÔÓéÀÖ(xinhui)¹Ù·½ÍøÕ¾_öλÔÓéÀÖappÏÂÔØÈë¿Ú
</