qp編程
不需要。
#include<stdio.h>
#include<math.h>
#definePI3.14159
intmain(){
doublehap[42],qp[42],ha[42],q[42],qpu[42],qu[42],vcav[42],hapr[1601],icav[42],c3[42],am[42],zeta[42],dz[42],r[42],har[42],has[42];
doublexl=1000.;
doubled=7.;
doublef[42]={0,.015,.015,.015,.415,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015,.015};
doubleg=32.2;
doublerp=.000137;
doubleq0=320.;
doubleck=4.77e7;
doublee=4.32e9;
doublew=.0833;
doublerg=1716.;
doublete=570.;
doublerho=1.923;
doublehb=33.5;
doubleamm=2.16e-5;
doubleamd=4.e-5;
doublehs0=33.5;
doublecmk=3.e-8;
doubleel[42]={0,5.,5.,5.,28.,28.,5.,5.,5.,5.,5.,5.,5.,5.,5.,5.};
double搜鄭hv=2.95;
doublehh[35]={0,60.694,55.75,51.08,46.96,43.39,40.37,37.9,35.97,34.5,
春穗33.78,33.5,33.78,34.5,35.97,37.9,40.37,43.39,46.96,
51.08,55.75,60.964};
intnh=21;
doubledtt=.5;
intiii=5;
doubletmax=13.1;
intn=10;
intipr=18;
intkit=5;
doubletol=.05;
intn2,iter,i,k,ns,i1,j;
doublex3,c2,b,po,dmdt,dt,xpp,x6,x2,qr,th,hhh,x1,ar,ff,t,th1,c1,z1,cm2,x4,z2,xp,cp,dfdh,gam,cm,x5,aa,qs,dh,s;
FILE*fp;
fp=fopen("cprintf.txt","a+");
//! namelist/din/xl,d,f,g,rp,el,q0,hv,ck,e,w,rg,te,rho,hh,amd,hb;
//!2amm,hs0,cmk,tol,tmax,n,ipr,kit,nh,dtt,iii;
//!10read(5,din,fclose(fp);return0=99);
ns=n+1;//!模擬的管道劃分的段數,ns是節點數
n2=n/10;//!n2的含義未知
ar=.7854*d*d;//!ar是管道的面積
gam=rho*g;//!比重
c1=1.+ck*d/(e*w);//!公式8-6中的1+kl*d/ee;
c2=rg*te*ck/(c1*gam*gam);//!111頁中的c3=c2*m/r的c2*/r/r,c2位8-7也即是說對應書中的是c3;
//!aa對應的是書上的公式8-6;
aa=sqrt(ck/(rho*c1));//!公式8-6;
b=aa/(g*ar);
//!時間間隔
dt=xl/(aa*n);扒漏卜//!對應的時步長
cm2=(hs0-hv)/amd;//!絕對蒸汽壓力,這個公式到底是怎麼得到的?
//!hh規定為時間的函數,用來表示由泵產生的絕對壓頭
//!z是出水管的高度
//!rp是在泵的下游管系中,從入口到截面1間包括全部損失的一個損失系數。
ha[1]=hh[1]-rp*q0*q0-el[1];
for(i=1;i<=ns;i++){//20
dz[i]=el[i+1]-el[i];
r[i]=f[i]*xl/(2.*g*d*ar*ar*n);
if(i>1)ha[i]=ha[i-1]-r[i-1]*q0*q0-dz[i-1];//!穩態時的各個截面上的壓頭
hap[i]=ha[i];
har[i]=ha[i];
has[i]=ha[i];
q[i]=q0;
qu[i]=q0;
//!沒有自由空氣時,a'=a即公式8-13中的c3=0;
c3[i]=0.;
//!起始時刻的插值系數為1,即不用插值,作用是賦初值
zeta[i]=1.;
//!icav[i]和vcav[i]用來控制氣穴的的,如果沒有氣血纏身則置為0;
icav[i]=0;
vcav[i]=0.;
l20:am[i]=0.;//!am[i]表示的是c3=c2*m/r/r中的m,起始時刻的空氣的質量為0;
}
hapr[1]=ha[iii];
th=dt*n/xl;
//!????這個公式的物理意義是什麼呢?xl是管線總的長度,n是管線分成的段數,dt是時間間隔,th是波速的倒數,但是物理意義是什麼呢?
t=0.;
k=0;
fprintf(fp,"a,xl,d,f=%8.1lf%8.1lf%8.4lf%8.4lf ",aa,xl,d,f[1]);
fprintf(fp,"h0,q0,rp=%8.2lf%8.2lf%8.5lf ",ha[ns],q0,rp);
fprintf(fp,"ck,e,w=%11.4e%11.4e%8.3lf ",ck,e,w);
fprintf(fp,"hv,rg,te,rho=%9.3lf%9.3lf%9.3lf%8.2lf ",hv,rg,te,rho);
fprintf(fp,"amd,amm,cmk,hs0=%11.4e%11.4e%11.4e%8.3lf ",amd,amm,cmk,hs0);
fprintf(fp,"g,tmax,b,dt,tol=%8.3lf%8.1lf%8.1lf%8.4lf%8.4lf ",g,tmax,b,dt,tol);
fprintf(fp,"hb,dtt,nh=%8.1lf%8.4lf%4d ",hb,dtt,nh);
fprintf(fp,"n,ipr,kit,iii%4d%4d%4d%4d ",n,ipr,kit,iii);
fprintf(fp,"pressureheads,discharges,airmass,zeta,andcavsize ");
fprintf(fp,"timex/l=0.0.10.20.30.40.50.60.70.80.91.0 ");
l30:fprintf(fp,"0%7.3lf,ha=",t);
for(i=1;i<=ns;i+=n2)fprintf(fp,"%8.2lf",ha[i]);
fprintf(fp," q=");
for(i=1;i<=ns;i+=n2)fprintf(fp,"%8.3lf",q[i]);
fprintf(fp," am=");
for(i=1;i<=ns;i+=n2)fprintf(fp,"%8.1e",am[i]);
fprintf(fp," z=");
for(i=1;i<=ns;i+=n2)fprintf(fp,"%8.4f",zeta[i]);
fprintf(fp," ,vcav=");
for(i=1;i<=ns;i+=n2)fprintf(fp,"%8.5f",vcav[i]);
fprintf(fp," ");
l40:k=k+1;
t=t+dt;
if(t>tmax)gotol145;
for(i=1;i<=n;i++){//50
if(am[i]==amm)gotol50;
dmdt=cmk*(hs0-cm2*am[i]-.5*(ha[i]+ha[i+1]));//!dmdt表示的含義未知
if(dmdt>0.);
am[i]=am[i]+dmdt*dt;
if(am[i]>amm)am[i]=amm;
c3[i]=am[i]*c2;//!!!!書上111頁的c3;
l50:continue;
}
//cupstreamboundary;
i=t/dtt+1;//!dtt到底是什麼
if(i>=nh)gotol53;//!nh的含義未知
th1=(t-(i-1)*dtt)/dtt;//!dtt和th1的含義未知
hhh=hh[i]*(1.-th1)+th1*hh[i+1]-el[1];//!hhh的含義未知
gotol54;
l53:hhh=hh[nh]-el[1];
l54:iter=0;
if(rp==0.)hap[1]=hhh;
x4=sqrt(c3[1]);
l55:iter=iter+1;
if(abs(hap[1]-has[1])>.001)gotol56;
zeta[1]=1./sqrt(1.+c3[1]/pow(hap[1],2));//!此處有問題,省略的不對。需要驗證
gotol59;
l56:x5=sqrt(c3[1]+hap[1]*hap[1]);
xpp=x5-x4*log((x4+x5)/hap[1]);
x5=sqrt(c3[1]+has[1]*has[1]);
zeta[1]=(hap[1]-has[1])/(xpp-x5+x4*log((x4+x5)/has[1]));
l59:has[1]=ha[1]+zeta[1]*(ha[2]-ha[1]);
qs=q[1]+zeta[1]*(qu[2]-q[1]);
x5=sqrt(c3[1]+has[1]*has[1]);
cm=x5-x4*log((x4+x5)/has[1])-qs*(b-r[1]*abs(qs))+dz[1];
if(rp==0.)gotol64;
for(i=1;i<=kit;i++){//63
s=1.;
x2=hhh-hap[1];
if(x2<0)gotol57;
elseif(x2==0)gotol62;
elsegotol58;
l57:s=-1.;
l58:if(abs(x2)<1.e-5)gotol62;
x1=s*b*sqrt(s*x2*rp);//!x1,x3意義不明確
x3=.5*b/sqrt(s*x2*rp);
gotol61;
l62:x1=0.;
x3=0.;
l61:x5=sqrt(c3[1]+hap[1]*hap[1]);
x6=(x4+x5)/hap[1];
ff=x5-x4*log(x6)-cm-x1;
dfdh=1./x6+x4/hap[1]+x3;
dh=-ff/dfdh;
hap[1]=hap[1]+dh;
if(abs(dh)<tol)gotol64;
l63:if(hap[1]<hv)hap[1]=hv;
}
l64:if(iter<3)gotol55;
x5=sqrt(c3[1]+hap[1]*hap[1]);
qp[1]=(x5-x4*log((x4+x5)/hap[1])-cm)/b;
l65:qpu[1]=qp[1];
//cinteriorsection;
for(i=2;i<=n;i++){//90
i1=i-1;
iter=1;
x1=sqrt(c3[i1]);
x4=sqrt(c3[i]);
gotol67;
l66:iter=iter+1;
z1=zeta[i1];
z2=zeta[i];
if(iter>5)gotol90;//!!!!是大於還是小於未定
l67:if(abs(hap[i]-hap[i1])>0.001)gotol68;
zeta[i1]=1./sqrt(1.+c3[i1]/pow(hap[i],2));
gotol69;
l68:x2=sqrt(c3[i1]+hap[i]*hap[i]);
xp=x2-x1*log((x1+x2)/hap[i]);
x2=sqrt(c3[i1]+hap[i1]*hap[i1]);
zeta[i1]=(hap[i]-hap[i1])/(xp-x2+x1*log((x1+x2)/hap[i1]));
l69:if(abs(hap[i]-has[i])>0.001)gotol70;
zeta[i]=1./sqrt(1.+c3[i]/pow(hap[i],2));
gotol72;
l70:x5=sqrt(c3[i]+hap[i]*hap[i]);
xpp=x5-x4*log((x4+x5)/hap[i]);
x5=sqrt(c3[i]+has[i]*has[i]);
zeta[i]=(hap[i]-has[i])/(xpp-x5+x4*log((x4+x5)/has[i]));
l72:if(iter==1||icav[i]==1)gotol74;
if(abs(zeta[i1]-z1)<.001&&abs(zeta[i]-z2)<0.001)gotol90;
l74:hap[i1]=ha[i]-zeta[i1]*(ha[i]-ha[i1]);
qr=qu[i]-zeta[i1]*(qu[i]-q[i1]);
x2=sqrt(c3[i1]+hap[i1]*hap[i1]);
has[i]=ha[i]-zeta[i]*(ha[i]-ha[i+1]);
qs=q[i]-zeta[i]*(q[i]-qu[i+1]);
x5=sqrt(c3[i]+has[i]*has[i]);
cp=x2-x1*log((x1+x2)/hap[i1])+qr*(b-r[i1]*abs(qr))-dz[i1];
cm=x5-x4*log((x4+x5)/has[i])-qs*(b-r[i]*abs(qs))+dz[i];
if(icav[i]==1)gotol85;
l80:for(j=1;j<=kit;j++){//89
x2=sqrt(c3[i1]+hap[i]*hap[i]);
x3=(x1+x2)/hap[i];
x5=sqrt(c3[i]+hap[i]*hap[i]);
x6=(x4+x5)/hap[i];
ff=x2-x1*log(x3)+x5-x4*log(x6)-cp-cm;
dfdh=1./x3+1./x6+(x1+x4)/hap[i];
dh=-ff/dfdh;
hap[i]=hap[i]+dh;
if(abs(dh)<tol)gotol82;
l89:if(hap[i]<hv)hap[i]=hv-0.0001;
}
l82:if(hap[i]<hv)gotol85;
x2=sqrt(c3[i1]+hap[i]*hap[i]);
qpu[i]=(cp-x2+x1*log((x1+x2)/hap[i]))/b;
qp[i]=qpu[i];
gotol66;
l85:hap[i]=hv;
icav[i]=1;
if(iter==4)gotol86;
if(icav[i1]==0||icav[i+1]==0)gotol66;
l86:x2=sqrt(c3[i1]+hap[i]*hap[i]);
x3=(x1+x2)/hap[i];
x5=sqrt(c3[i]+hap[i]*hap[i]);
x6=(x4+x5)/hap[i];
qpu[i]=(cp-x2+x1*log(x3))/b;
qp[i]=(x5-x4*log(x6)-cm)/b;
vcav[i]=vcav[i]+.5*dt*(qp[i]+q[i]-qpu[i]-qu[i]);
if(vcav[i]>0.)gotol90;
icav[i]=0;
vcav[i]=0.;
gotol80;
l90:continue;
}
//cdownstreamboundary;
iter=0;
x1=sqrt(c3[n]);
l109:iter=iter+1;
if(abs(hap[ns]-hap[n])>0.001)gotol110;
zeta[n]=1./sqrt(1.+c3[n]/pow(hap[ns],2));
gotol112;
l110:x2=sqrt(c3[n]+hap[ns]*hap[ns]);
xp=x2-x1*log((x1+x2)/hap[ns]);
x2=sqrt(c3[n]+hap[n]*hap[n]);
zeta[n]=(hap[ns]-hap[n])/(xp-x2+x1*log((x1+x2)/hap[n]));
l112:hap[n]=ha[ns]-zeta[n]*(ha[ns]-ha[n]);
if(iter<4)gotol109;
x2=sqrt(c3[n]+hap[n]*hap[n]);
qr=qu[ns]-zeta[n]*(qu[ns]-q[n]);
cp=x2-x1*log((x1+x2)/hap[n])+qr*(b-r[n]*abs(qr))-dz[n];
x2=sqrt(c3[n]+hap[n]*hap[n]);
qp[ns]=(cp-x2+x1*log((x1+x2)/hap[ns]))/b;
qpu[ns]=qp[ns];
for(i=1;i<=ns;i++){//140
po=ha[i];
ha[i]=hap[i];
hap[i]=2.*ha[i]-po;
if(hap[i]<hv)hap[i]=hv;
q[i]=qp[i];
l140:qu[i]=qpu[i];
}
hapr[k+1]=ha[iii];
if(ha[iii]>hs0)gotol30;
if(k/ipr*ipr-k<0)gotol40;
elseif(k/ipr*ipr-k==0)gotol30;
elsegotol40;
l145:for(i=1;i<=k;i++){
fprintf(fp,"%6.1lf",hapr[i]);
if(i%10==0)fprintf(fp," ");
}
//!gotol10;
l99:fclose(fp);
return0;
}
② 求c語言編程題,謝謝各位大神。輸入正整數n,再輸入n個實數,將它們從小到大排序後輸出。
#include<stdio.h>
#include<conio.h>
#defineLEN100/*數組長度上限*/
#defineelemTypeint/*元素類型*/
/*輸入數組*/
voidinputArr(elemTypearr[],intlen){
inti;
for(i=0;i<len;i++)
scanf("%d",&arr[i]);
putchar(' ');
}
/*列印數組*/
voidprintArr(elemTypearr[],intlen){
inti;
for(i=0;i<len;i++)
printf("%d ",arr[i]);
putchar(' ');
}
/*升序游空冒泡排序*/
/*參數說明:*/
/*intarr[]:排序目標數組*/
/*int仿帶len:元素個數*/
voidsort_qp(elemTypearr[],intlen){
elemTypetemp;
inti,j;
for(i=0;i<len-1;i++)
for(j=0;j<len-1-i;j++){
if(arr[j]>arr[j+1]){
temp=arr[j];
arr[j]=arr[j+1];
arr[j+1]=temp;
}
}
}
intmain(void){
elemTypearr[LEN];
intlen;
printf("請輸入數組元素個數:");
scanf("%d",&len);
printf("請輸神大瞎入包含%d個元素的數組: ",len);
inputArr(arr,len);
puts("排序後數組:");
sort_qp(arr,len);/*升序冒泡排序*/
printArr(arr,len);
putchar(' ');
getch();/*屏幕暫留*/
free(arr);
return0;
}
運行結果
③ 請教各位數控車床G73指令中QP程序開始段號和結束段號數直是怎樣算出來的
編程的時候不自動生成行號,直接脊念用P10 Q20,然後在循陵冊環體開始的程序行前加N10,在結束段前加N20就可以尺野宏了。
④ 編程都有哪些語言
目前熱門的語言有:C、C++、JAVA、VB、VC、FoxPro、Delphi、SQL、PHP、ASP、JSP等等。
專門有機構為編程語言進行排名,如下圖:
⑤ qp英文單詞什麼意思
1.在生物學中,PQ(plastoquinone,PQ)質體醌
2.指彼得定理中的提升商數攜攔(PQ)
3.指體能商數。
4.picture quality,畫質。
5.priority queueing,吵隱或優先隊列演算法。
6.Proction Quality,產品質量
7.Performance Qualification 性能確認
8.Programming Quotient :PQ越高的程序員編程越有前瞻
9. =Province of Quebec 魁北克省
10. PartitionMagic.PowerQuest PartitionMagic(簡稱PQ、PM)是一個優秀硬碟分區管理工具。該工具可以在不損失硬碟中已有數據的前提下對硬碟進行重新分區、格式化分區、復制分區、移動分區、隱藏/重現分區、從任意分區引導系統、轉換分區(如FATFAT32 )結構升伍屬性等。功能強大,可以說是目前在這方面表現最為出色的工具。
看你自己是在哪個方面用了
⑥ qp在洛谷什麼意思
qp在洛谷什麼意思,內容如下:
洛谷是戚襲基於網頁形式的信息學在線評測系統。同時具有多種社區功能。
QuickPass:快速報關/通關系統。
目前企業安裝QP系統是紙質手核備冊電子化試點的要求,電子化手冊項下的報關單必須使用QP系統錄入,如果代理報關公司沒有安裝QP系統,將無法預錄入報關單數據。
洛谷創辦於2013年,出道名為「洛谷OnlineJudge」,致力於為高氏兄oiers/acmers提供清爽、快捷的編程體驗。它不僅僅是一個在線測題系統,它擁有強大的社區、在線學習功能。同時,許多教程內容都是由五湖四海的oiers提供的,保證了內容的廣泛性。無論是初學oi的__,還是久經沙場的神_,均可從洛谷獲益,也可以幫助他人,共同進步。