我也只是半吊子,解釋不清請見諒
#include<iostream>
using namespace std;
int main()
{
int t ; //按題目敘述設定一個次數的變數t
cin >> t ;
for(int i=1; i<=t;i++){ //設定迴圈次數的變數i,,每做一次迴圈i就+1,在迴圈做到t次後(i<=t)停止
int a, b, c, d, e;
cin >> a >> b >> c >> d;
if(b-a==d-c){ //如果是等差數列
e = d+(b-a) ;
cout << a <<" " << b <<" "<< c <<" "<< d <<" "<< e << endl;}
else if((b/a) == (d/c)){ //如果是等差數列
e = d*(b/a) ;
cout << a <<" " << b <<" "<< c <<" "<< d <<" " << e << endl;}
}
return 0 ;
}