以下是我的程式碼
#include<iostream>
using namespace std;
int main(int argc, char* argv[]) {
int i, t, arr[80] = {0};
while (cin >> t) {
if (t == 0)
break;
for (i = 0; i < t * 4; i = i + 1)
cin >> arr[i];
for (i = 0; i < t * 4; i = i + 4) {
if ((arr[i + 2] - arr[i + 1] == arr[i + 1] - arr[i]))
cout << arr[i] << ' ' << arr[i + 1] << ' ' << arr[i + 2] << ' ' << arr[i + 3] << ' ' << arr[i + 1] - arr[i] + arr[i + 3] << endl;
if ((arr[i + 2] / arr[i + 1] == arr[i + 1] / arr[i]))
cout << arr[i] << ' ' << arr[i + 1] << ' ' << arr[i + 2] << ' ' << arr[i + 3] << ' ' << arr[i + 1] / arr[i] * arr[i + 3] << endl;
}
}
return 0;
}
試了很久都找不出錯在哪@@