a005.
Eva 的回家作業
--
POJ
| From: [140.112.42.150] |
發表日期
:
2013-11-09 14:54
#include <iostream>
using namespace std ;
int main()
{
int num , a , b , c , d , e , ba , cb , dc ,h, k;
cin>>num;
for (k=1; k<num ; k++)
{
while (cin >> a >> b >> c >> d)
{
ba = b-a ;
cb = c-b ;
dc = d-c ;
h = d/c ;
if ( ba== cb == dc )
{
cout<< a <<" "<< b <<" "<< c <<" "<< d <<" "<< d+ba <<endl ;
}
else
{
cout << a <<" "<< b <<" "<< c <<" "<< d <<" "<< d*h <<" "<<endl;
}
}
}
}