这是我的一个课程设计
源代码在线查看: erlangb.cpp
#include"stdio.h"
FILE *f;
double block(double ld)
{
int c;
double mu,A;
c=10;mu=0.1;
A=ld/mu;
int i,j,k,n;
n=1;
double sum,jj,p00;
sum=0;
for(i=0;i {
jj=1;
n=1;
for(j=i;j>=1;j--)
{
n=n*j;
}
for(k=1;k {
jj=jj*A;
}
p00=jj/n;
sum=sum+p00;
}
double blockpro;
blockpro=p00/sum;
printf("%f ",blockpro);
return blockpro;
}
void main()
{
f=fopen("out.txt","w");
double ld,blockpro;
ld=0.19;
do{
ld=ld+0.01;
blockpro=block(ld);
fprintf(f,"%f ",blockpro);
}while(ld fclose(f);
}