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 s1270758234 at 2012-08-02 20:49:59 on Problem 1658
#include<iostream>
using namespace std;
int main()
{
	int n,a,d,i;
	int s[10];
	cin>>n;
	while(n--)
	{
		for(i=0;i<4;i++)
		{
			cin>>a;
			s[i]=a;
		}
		if((s[3]-s[2])==(s[2]-s[1]))

        {
			d=s[3]-s[2];
		    s[4]=s[3]+d;
		}
		else
		{
			d=s[3]/s[2];
		s[4]=s[3]*d;
		}
		for(i=0;i<5;i++)
		{  if(i<4)
			cout<<s[i]<<" ";
		else
			cout<<s[i]<<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