a005.
Eva 的回家作業
--
POJ
| From: [120.127.47.211] |
發表日期
:
2013-06-16 12:19
#include <iostream>
using namespace std;
int main()
{
int ans,a[20],b[20],c[20],d[20],k,r,i;
cin>>ans;
for(i=0;i<ans;i++)
{
cin>>a[i]>>b[i]>>c[i]>>d[i];
}
cout<<endl;
for(int i=0;i<ans;i++)
{
if(b[i]-a[i]==c[i]-b[i])
{
k=b[i]-a[i];
cout<<a[i]<<" "<<b[i]<<" "<<c[i]<<" "<<d[i]<<" "<<d[i]+k;
}
if(b[i]/a[i]==c[i]/b[i])
{
r=b[i]/a[i];
cout<<a[i]<<" "<<b[i]<<" "<<c[i]<<" "<<d[i]<<" "<<d[i]*r;
}
cout<<endl;
}
}