Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

Re:求助?(有代码)

Posted by tcxgsy at 2005-08-12 14:31:29 on Problem 2555
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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator