烈焰蔷薇骑士团杀不杀:怎么显示不出来

来源:百度文库 编辑:高校问答 时间:2024/04/27 23:20:39
#include<stdio.h>
#define NULL 0
struct student
{
long num;
float score;
struct student *next;
};
void main()
{
struct student a,b,c,*head,*p;
a.num=10101;a.score=89.5;
b.num=10103;b.score=90;
c.num=10107;c.score=85;
head=&a;
a.next=&b;
b.next=&c;
c.next=NULL;
p=head;
do
{
printf("%ld%d5.1f\n",p->num,p->score);
p=p->next;
}
while(p!=NULL);
}

#include<stdio.h>
#define NULL 0
struct student
{
long num;
float score;
struct student *next;
};
void main()
{
struct student a,b,c,*head,*p;
a.num=10101;a.score=89.5;
b.num=10103;b.score=90;
c.num=10107;c.score=85;
head=&a;
a.next=&b;
b.next=&c;
c.next=NULL;
p=head;
do
{
printf("%ld %5.1fd \n",p->num,p->score); //5.1f写在d前面
p=p->next;
}
while(p!=NULL);
}

看看这样行不行