POJ 1658 Eva's Problem C++版

题目链接:http://poj.org/problem?id=1658

最近光做水题!

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/***************************************
Problem: 1658 User: awq123
Memory: 248K Time: 0MS
Language: C++ Result: Accepted
***************************************/
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;

int main()
{
int d[5],i,t;
cin>>t;
while(t--)
{
for(i=0;i<4;i++)
cin>>d[i];
if(d[1]-d[0]==d[2]-d[1]&&d;[2]-d[1]==d[3]-d[2])
d[4]=d[3]+d[3]-d[2];
if(d[1]/d[0]==d[2]/d[1]&&d;[2]/d[1]==d[3]/d[2])
d[4]=d[3]*d[3]/d[2];
for(i=0;i<5;i++)
cout<<d[i]<<" ";
cout<<endl;
}

}