Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class a005 {
- public static void main (String args[]) {
- Scanner cin = new Scanner(System.in);
- int t, a, b, c, d;
- t = cin.nextInt();
- while(t-- != 0) { //t-- 是好方法,不用for()來計算
- a = cin.nextInt(); //當變數少的時候,abcd比num[4]來得方便
- b = cin.nextInt();
- c = cin.nextInt();
- d = cin.nextInt();
- System.out.print(a + " " + b + " " + c + " " + d +" ");
- if(a-b == c-d)
- System.out.println(d+(d-c));
- else
- System.out.println(d*d/c);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement