不知道是我誤解題目還是?
WA:line 2 我的答案是:
正確答案:1 2 4 8 16
請各位撥點時間指導我一下 感謝
#include <iostream>
using namespace std;
int main()
{
int a,b,c,d,e,t;
while(cin >> t)
{
while(t--)
{
cin >>a>>b>>c>>d;
if(a<100001 && b<100001 && c< 100001 && d<100001)
{
if((d-c) == (b-a))
{
e=d+(b-a);
if(e<100001)
{
cout << a<< " "<< b<< " "<< c<< " "<< d<< " "<< e << endl;
}
else
{
cout <<" "<<endl;
}
}
if( (b/a) == (d/c) )
{
e=d*(d/c);
if(e<100001)
{
cout << a<< " "<< b<< " "<< c<< " "<< d<< " "<< e << endl;
}
else
{
cout<< " "<< endl;
}
}
else
{cout<< " "<<endl;}
}
}
}
}