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

why wa???? who can tell me

Posted by rick199186 at 2010-04-05 22:00:26 on Problem 3299
#include<iostream>
#include<iomanip>
#include<cmath>

using namespace std;


int main()
{
	char letter = '\0';
	double data[10][3] = {0};
	int i = 0, j = 0;


//input data

	cin>>letter;

	for( i = 0; letter != 'E'; i++)
	{
		switch(letter)
		{
		case 'T':
			cin>>data[i/2][0];
			break;

		case 'D':
			cin>>data[i/2][1];			
			break;

		case 'H':
			cin>>data[i/2][2];
			break;

		default:
			break;
		}

		cin>>letter;
	}

//process data

	for( j = 0; j < i/2; j++)
	{
		if( !data[j][0] )
			data[j][0] = data[j][2]-0.5555*(6.11*exp(5417.7530*((1/273.16)-(1/(data[j][1]+273.16))))-10);
		else if( !data[j][1] )
			data[j][1] = 273.16*5417.7530/(5417.7530-273.16*log(((data[j][2]-data[j][1])/0.5555+10)/6.11))-273.16;
		else
			data[j][2] = data[j][0]+0.5555*(6.11*exp(5417.7530*((1/273.16)-(1/(data[j][1]+273.16))))-10);
	}

//print data

	for( j = 0; j < i/2; j++)
		cout<<"T "<<fixed<<setprecision(1)<<data[j][0]<<" D "<<data[j][1]<<" H "<<data[j][2]<<endl;

	return 0;
}

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