a005.
Eva 的回家作業
--
POJ
| From: [1.172.246.190] |
發表日期
:
2013-09-19 15:42
import java.util.Scanner;
public class a005 {
public static void main (String[] args) {
Scanner cin = new Scanner(System.in);
int k = cin.nextInt();
int[][] x;
x = new int[k][5];
for (int i = 0; i < x.length; i++) {
Scanner bin = new Scanner(System.in);
for (int j = 0; j < 4; j++) {
x[i][j] = bin.nextInt();
}
}
for (int i = 0; i < x.length; i++) {
if (x[i][3]-x[i][2] == x[i][2]-x[i][1] && x[i][2]-x[i][1] == x[i][1]-x[i][0])
x[i][4] = x[i][3]+x[i][3]-x[i][2];
else
x[i][4] = x[i][3]/x[i][2]*x[i][3];
}
for (int i = 0; i < x.length; i++) {
for (int j = 0; j < x[i].length; j++) {
if (j == 4)
System.out.print(x[i][j] + "\n");
else
System.out.print(x[i][j] + " ");
}
}
}
}
他出現RE .... 可是我自己測可以跑的出 Q_0 我花了6小時才弄出來