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 |
是哪错了呢?(有CODE)#include<iostream> #include<stdio.h> using namespace std; typedef struct ice_water{ double m; double c; }iw; iw ice,water; void main() { while(cin>>water.m>>ice.m&&ice.m!=0&&water.m!=0) { cin>>water.c>>ice.c; double ans,wm,im; if(water.m*4.19*water.c>ice.m*2.09*(-ice.c)+335*ice.m) { ans=(4.19*water.c*water.m-2.09*(-ice.c)*ice.m-335*ice.m)/(4.19*(water.m+ice.m)); wm=water.m+ice.m; im=0; } else if(ice.m*2.09*(-ice.c)>water.m*4.19*water.c+335*water.m) { ans=-(2.09*(-ice.c)*ice.m-4.19*water.c*water.m-335*water.m)/(2.09*(ice.m+water.m)); wm=0; im=water.m+ice.m; } else { ans=0; wm=water.m+(4.19*water.m*water.c-2.09*(-ice.c)*ice.m)/335; im=water.m+ice.m-wm; } printf("%.1f g of ice and %.1f g of water at %.1f C\n",im,wm,ans); } } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator