Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
Re:求助?(有代码)In Reply To:求助? Posted by:tcxgsy at 2005-08-12 14:23:49 #include"stdio.h" #include"math.h" #define cw 4.19 #define ci 2.09 #define temp 355 void main() { double mw,mi,tw,ti; scanf("%lf%lf%lf%lf",&mw,&mi,&tw,&ti); while(mw||mi||tw||ti) { if((mw*cw*tw)>((-mi*ci*ti)+temp*mi)) printf("0.0 g of ice and %.1lf g of water at %.1lf C\n",(mw+mi), ((mw*cw*tw+mi*ci*ti-temp*mi)/(mw*cw+mi*cw))); else if((-mi*ci*ti)<(mw*cw*tw+mw*temp)) printf("%.1lf g of ice and %.1lf g of water at 0.0 C\n",mi,mw); else printf("%.1lf g of ice and 0.0 g of water at %.1lf C\n",(mw+mi), ((mw*cw*tw+mw*temp+mi*ci*ti)/(mi*ci+mw*ci))); scanf("%lf%lf%lf%lf",&mw,&mi,&tw,&ti); } } 改成这样仍然错误 Followed by:
Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator