Skip to content

Instantly share code, notes, and snippets.

@henryyang42
Created February 24, 2014 15:59
Show Gist options
  • Save henryyang42/9191066 to your computer and use it in GitHub Desktop.
Save henryyang42/9191066 to your computer and use it in GitHub Desktop.
#include<iostream>
using namespace std;
int main(){
int count=0;
cin >> count;
for(int i=1;i<=count;i++){
int *array = new int[5];
for(int integer=0;integer<4;integer++){
int hold = 0;
cin >> hold;
array[integer]=hold;
}
if((array[1]-array[0])==(array[2]-array[1])){
array[4]=array[3]+(array[2]-array[1]);
}
else array[4]=array[3]*(array[2]/array[1]);
for(int i=0;i<=4;i++){
cout<<array[i]<<" ";
}
cout << "\n";
delete array;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment