其他分享
首页 > 其他分享> > zuoye

zuoye

作者:互联网

#include<stdio.h>
#include<stdlib.h>

typedef struct fushu
{
	int xubu;
	int shibu;
	struct fushu *next;

}fushu_node,*fushu;


int MUL(fushu *A,fushu B,fushu C)
{
	fushu D;
	D.shibu=B.shibu*C.shibu-B.xubu*C.xubu;
	D.xubu=B.shibu*C.xubu+B.xubu*C.shibu

	return D;


}
int ADD(fushu *A,fushu B,fushu C)
{
	fushu D;
	D.shibu=B.shibu+C.shibu;
	D.xubu=B.xubu+C.xubu;
	return D;


}

int SUB(fushu *A,fushu B,fushu C)
{
	fushu D;
	D.shibu=B.shibu-C.shibu;
	D.xubu=B.xubu-C.xubu;
	return D;

}

int DIV(fushu *A,fushu B,fushu C)
{
	fushu D;
	D.shibu=B.shibu*C.shibu+B.xubu*C.xubu;
	D.xubu=B.xubu*C.shibu-B.shibu*C.xubu;

    return D;
}




int main()
{
 
int i,j=1,k,LEN;
	fushu L,p,q;
	
	L=(fushu)malloc(sizeof(fushu_node));
	L->next=NULL;
	q=L;
	printf("enter the number of complexnumber:")
		scanf("%d",&LEN);

	for(i=0;i<LEN;i++)
	{
		p=(fushu)malloc(sizeof(fushu_node));
		printf("enter the realpart of number%d ",j)
		scanf("%d",&(p->shibu));
		printf("enter the imagepart of number%d ",j)
		scanf("%d",&(p->xubu));
		p->next=NULL;
		q->next=p;
		q=p;
		j++;
	}

return 0;
}

 e

标签:return,int,zuoye,xubu,next,shibu,fushu
来源: https://www.cnblogs.com/P201821430022/p/11790624.html