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

看看有什么区别??

Posted by ding59 at 2008-09-21 10:56:43 on Problem 1658
#include<stdio.h>
void main()
{
	long int a,b,c,d;
	int i,n;
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%d%d%d%d",&a,&b,&c,&d);
		if((b-a)==(c-b)&&(c-d)==(d-c))
			printf("%d %d %d %d %d\n",a,b,c,d,2*d-c);
		else printf("%d %d %d %d %d\n",a,b,c,d,(d*d)/c);
	}
}


#include<iostream>
using namespace std;

int main()
{
    long a[4];
    int n;
    long  d;
    cin>>n;
    for(int i =1; i<=n; i++)
    {
     cin>>a[0]>>a[1]>>a[2]>>a[3];
     if((a[1]-a[0]==a[2]-a[1])&&(a[3]-a[2]==a[2]-a[1])) 
      cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<" "<<a[3]<<" "<<a[3]+a[2]-a[1]<<endl;
     else
     
       cout<<a[0]<<" "<<a[1]<<" "<<a[2]<<" "<<a[3]<<" "<<a[3]*a[1]/a[0]<<endl;
     }
      
    
}

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