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

谁帮我看看哪里错了。。老wa~~~

Posted by lyhypacm at 2009-11-30 21:13:25 on Problem 1658
#include <iostream>
#include <fstream>
using namespace std;

int main()
{
	int N;	//组数
	int a[21][6]={0};
	int i,j;
	
	ifstream cin("1658.txt");
	cin>>N;
	for(i=0;i<N;i++)
	{
		for(j=0;j<4;j++)
		{
			cin>>a[i][j];
		}
		if(((a[1]-a[0])==(a[2]-a[1]))&&((a[3]-a[2])==(a[2]-a[1])))
			a[i][4]=2*a[i][3]-a[i][2];
		else
			a[i][4]=a[i][3]*((float)a[i][3]/a[i][2]);
	}
	
	for(i=0;i<N;i++)
	{
		for(j=0;j<5;j++)
		{
			cout<<a[i][j];
			if(j<4) cout<<" ";
		}
		cout<<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