
能把汇编语言源程序翻译成目标的程序称为
2个回答
推荐于2018-04-14 · 知道合伙人互联网行家
关注

展开全部
#include"stdio.h"
#include"malloc.h"
#define LEN sizeof(struct student)
struct student
{
long int num;
float score;
struct student *next;
};
struct student *creat(void)
{
struct student *head;
struct student *p1,*p2;
int n=0;
p2=p1=(struct student*)malloc(LEN);
printf("请输入学号和成绩: \n");
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);
printf("请输入学号和成绩: \n");
scanf("%ld%f",&p1->num,&p1->score);
}
p2->next=NULL;
return(head);
}
void main()
{
struct student a,b,c;
struct student *head,*p,*result;
a.num=99101;a.score=89.5;
b.num=99103;b.score=90;
c.num=99107;c.score=85;
head=&a;
a.next=&b;
b.next=&c;
c.next=NULL;
p=head;
do
{
printf("%ld%5.lf\n",p->num,p->score);
p=p->next;
}
while(p!=NULL);
result = creat();
do
{
printf("%ld%5.lf\n",result->num,result->score);
result=result->next;
}
while(result!=NULL);
}
#include"malloc.h"
#define LEN sizeof(struct student)
struct student
{
long int num;
float score;
struct student *next;
};
struct student *creat(void)
{
struct student *head;
struct student *p1,*p2;
int n=0;
p2=p1=(struct student*)malloc(LEN);
printf("请输入学号和成绩: \n");
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);
printf("请输入学号和成绩: \n");
scanf("%ld%f",&p1->num,&p1->score);
}
p2->next=NULL;
return(head);
}
void main()
{
struct student a,b,c;
struct student *head,*p,*result;
a.num=99101;a.score=89.5;
b.num=99103;b.score=90;
c.num=99107;c.score=85;
head=&a;
a.next=&b;
b.next=&c;
c.next=NULL;
p=head;
do
{
printf("%ld%5.lf\n",p->num,p->score);
p=p->next;
}
while(p!=NULL);
result = creat();
do
{
printf("%ld%5.lf\n",result->num,result->score);
result=result->next;
}
while(result!=NULL);
}

2023-06-12 广告
单片机汇编程序是用汇编语言编写的程序,用于控制单片机的操作。汇编语言是一种比较接近计算机硬件语言的低级语言,相对于高级语言来说更容易理解和实现。下面是单片机汇编程序的基本步骤:1. 将代码和数据汇编到规定的段中。2. 在存储器中用未初始化的...
点击进入详情页
本回答由意法半导体(中国)投资有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询