#7858: 求救~結果是WA


S110116032 (阿楚)

學校 : 桃園市私立復旦高級中學
編號 : 32976
來源 : [120.127.47.211]
最後登入時間 :
2013-06-17 23:41:58
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;
}
}
 
ZeroJudge Forum