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:为什么总wa.....?

Posted by Johnnx at 2009-02-11 22:05:33 on Problem 3299
In Reply To:为什么总wa.....? Posted by:hello1806 at 2008-11-01 11:04:20
> #include <stdio.h>
> #include <stdlib.h>
> int main()
> {
> int i;
> float inputnum=0,temperature,dewpoint,humidex,temp,num;
>     char type,space;
>     while ((scanf ("%c",&type)==1)&&(type!='E')){
>     temperature=-101;dewpoint=-101;humidex=-101;
> 
>     switch (type)
>       {
>           case 'T':scanf ("%f ",&temperature);break;
>           case 'D':scanf ("%f " ,&dewpoint);break;
>           case 'H':scanf ("%f ",&humidex);break;
>           default:return 0;
>           }
> scanf ("%c ",&type);
> if (type=='E') return 0;
> 
> switch (type)
>       {
>           case 'T':scanf ("%f",&temperature);break;
>           case 'D':scanf ("%f",&dewpoint);break;
>           case 'H':scanf ("%f",&humidex);break;
>           }
>     if (temperature==-101)
>         {temp=1/(dewpoint+273.16);temp=1/273.16-temp;temp=5417.7530*temp;temp=exp(temp);
>         temp=0.5555*(6.11*temp-10.0);temperature=humidex-temp;
>         }
>     if (dewpoint==-101)
>         {temp=humidex-temperature;
>         temp=temp/0.5555+10.0;
>         temp=temp/6.11;
>         temp=log(temp);
>         temp=(float)1/273.16-temp/5417.7530;
>         temp=1/temp;
>         dewpoint=temp-273.16;
>         }
>     if (humidex==-101)
>         {temp=1/(dewpoint+273.16);temp=1/273.16-temp;temp=5417.7530*temp;temp=exp(temp);
>         temp=0.5555*(6.11*temp-10.0);humidex=temperature+temp;
>         }
>     printf ("T %.1f D %.1f H %.1f\n",temperature,dewpoint,humidex);
>     fflush(stdin);
>     }
> return 0;
> }
> 给的几个测试数据都对..还有什么没考虑到的地方么?3x

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