#include <iostream>
using namespace std;
int main(){
int a,b,c,d,t,e=1,f;
cin>>t;
while(t>=e)
{
cin>>a,b,c,d;
if(b-a==c-b)
{
f=d+(b-a);
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<f<<endl;
}
else
{
f=d*(b/a);
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<f<<endl;
}
++e;
}
return 0;
}
#include
using namespace std;
int main(){
int a,b,c,d,t,e=1,f;
cin>>t;
while(t>=e)
{
cin>>a,b,c,d;
if(b-a==c-b)
{
f=d+(b-a);
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<f<<endl;
}
else
{
f=d*(b/a);
cout<<a<<" "<<b<<" "<<c<<" "<<d<<" "<<f<<endl;
}
++e;
}
return 0;
}
cin格式錯誤
應更正為 cin>>a>>b>>c>>d;