a005.
Eva 的回家作業
--
POJ
| From: [163.22.18.120] |
發表日期
:
2010-07-04 21:03
我測試 1 2 3 4和 1 2 4 8印出的結果是對~ 可是還是過不了~
我不懂錯在哪裡~
import java.util.Scanner;
public class JAVA
{
public static void main(String [] argv)
{
int [] data = new int [4];
int a,b,c,d,e,f;
Scanner input= new Scanner(System.in);
f = input.nextInt();
for(int i = f; i>0 ;i--)
{
while(input.hasNext())
{
a = input.nextInt();
data[0] = a;
b = input.nextInt();
data[1] = b;
c = input.nextInt();
data[2] = c;
d = input.nextInt();
data[3] = d;
if(data[1]-data[0]==data[3]-data[2])
{
e = (data[3]-data[2])+data[3];
System.out.println(data[0]+" "+data[1]+" "+data[2]+" "+data[3]+" "+e);
}
else if(data[0]<<1 == data[1]&& data[1]<<1 == data[2]&& data[2]<<1 == data[3])
{
e = data[3]<<1;
System.out.println(data[0]+" "+data[1]+" "+data[2]+" "+data[3]+" "+e);
}
}
}
}
}