⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chayi.c

📁 用C编写的S-P表分析的算法
💻 C
字号:
#include "fuction.h"
void chayixishu()
{
	int s,p,p1,i,j=0,a,b,c,e=0,p2=0;
	int temp[Ns],top=0;
	for(i=0;i<Ns;i++)
	{
		s=Ss[Ns-i-1];
		S[s].Sthread=S[s].zhongfen;
		p=Pp[j];
		p1=P[p].zhongfen;
			for(j;j<Np;j++)
			{
                e=Pp[j];
				if(P[e].zhongfen!=p1)
				break;
			}
			temp[i]=j;//将P线存放在数组中
		}
	a=0;b=0;c=0;//将它们分别初始化为零
	for(i=0;i<Ns;i++)
	{
		s=Ss[Ns-i-1];
		p1=Pp[a];
		if(i==0)
			S[s].Pthread=0;
		else{
			S[s].Pthread=temp[top];
			b=temp[top];
			p2=Pp[b];
			c=(P[p1].zhongfen-P[p2].zhongfen)+c;
			c=c-1;
			if(c==0)
				top++;
            a=b;
		}
	}

	for(i=0;i<Ns;i++)
	{
		s=Ss[Ns-i-1];
		a=S[s].Pthread;
		b=S[s].Sthread;
		if(a>b)
		c=a-b;
		if(a==b)
			c=0;
		if(a<b)
		    c=b-a;
		mianji=mianji+1*c;
	}
    for(i=0;i<Np;i++)
	{
		total=P[i].zhongfen+total;
	}
	percent=total/(Np*Ns);
	D=mianji/(Np*Ns);
	Dx=D*0.7/(percent*(1-percent));
	printf("------------chayixishu---------------\n");
	printf("\nhayixishu shi %f*0.7/(%f*(1-%f)):=%f\n",D,percent,percent,Dx);
	
}
		


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -