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 sicojuy at 2010-10-25 14:10:20 on Problem 1658
In Reply To:谁帮我看看哪里错了。。老wa~~~ Posted by:lyhypacm at 2009-11-30 21:13:25
> #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;
> }


#include <stdio.h>
void main()
{
	short i, t, a, b, c, d;
	scanf("%d",&t);
	for(i = 0; i < t; i++)
	{
		scanf("%d%d%d%d",&a,&b,&c,&d);
		if(a + c == b + b)
			printf("%d %d %d %d %d\n",a,b,c,d,d+b-a);
		else
			printf("%d %d %d %d %d\n",a,b,c,d,d*b/a);
	}
}

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