| ||||||||||
| 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 | |||||||||
各位帮忙看一下我的代码,我本机测试没问题呀,是我哪里疏忽了吗?# include <stdio.h>
# include <math.h>
int main( void )
{
double d1, d2, d3, e, h ;
char c1, c2, c3 ;
while( scanf( "%c", &c1) && c1 != 'E' )
{
scanf( "%lf %c %lf", &d1, &c2, &d2 ) ;
getchar() ;
if( c1 == 'T' && c2 == 'D' )
{
e = 6.11 * exp( 5417.7530 * ( (1/273.16)-( 1/(d2+273.16) ) ) ) ;
h = ( 0.5555 ) * ( e - 10.0 ) ;
d3 = d1 + h ;
printf( "T %.1lf D %.1lf H %.1lf\n", d1, d2, d3 ) ;
continue ;
}
if( c1 == 'D' && c2 == 'T' )
{
e = 6.11 * exp( 5417.7530 * ( (1/273.16)-( 1/(d1+273.16) ) ) ) ;
h = ( 0.5555 ) * ( e - 10.0 ) ;
d3 = d2 + h ;
printf( "T %.1lf D %.1lf H %.1lf\n", d2, d1, d3 ) ;
continue ;
}
if( c1 == 'H' && c2 == 'D' )
{
e = 6.11 * exp( 5417.7530 * ( (1/273.16)-( 1/(d2+273.16) ) ) ) ;
h = ( 0.5555 ) * ( e - 10.0 ) ;
d3 = d1 - h ;
printf( "T %.1lf D %.1lf H %.1lf\n", d3, d2, d1 ) ;
continue ;
}
if( c1 == 'D' && c2 == 'H' )
{
e = 6.11 * exp( 5417.7530 * ( (1/273.16)-( 1/(d1+273.16) ) ) ) ;
h = ( 0.5555 ) * ( e - 10.0 ) ;
d3 = d2 - h ;
printf( "T %.1lf D %.1lf H %.1lf\n", d3, d1, d2 ) ;
continue ;
}
if( c1 == 'H' && c2 == 'T' )
{
h = d1 - d2 ;
e = h / 0.5555 + 10.0 ;
e /= 6.11 ;
d3 = log(e)/5417.7530 ;
d3 = 1/273.16-d3 ;
d3 = 1/d3 - 273.16 ;
printf( "T %.1lf D %.1lf H %.1lf\n", d2, d3, d1 ) ;
continue ;
}
if( c1 == 'T' && c2 =='H' )
{
h = d2 - d1 ;
e = h / 0.5555 + 10.0 ;
e /= 6.11 ;
d3 = log(e)/5417.7530 ;
d3 = 1/273.16-d3 ;
d3 = 1/d3 - 273.16 ;
printf( "T %.1lf D %.1lf H %.1lf\n", d1, d3, d2 ) ;
continue ;
}
return 0 ;
}
}
Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator