Created
February 24, 2014 15:59
-
-
Save henryyang42/9191066 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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