Input five integers in one line, with each integer separated by a space. Add the 1st and 2nd integers together and store the sum inside a variable. Add the 3rd and 4th integers together and store the sum inside a variable. Multiply the two sums and raise the product result to the power of the 5th integer. Print out the result. Input A line containing five integers separated by a space. 1·2·3·4·5 Output A line containing an integer. 4084101
The Answer to the Question
is below this banner.
Can't find a solution anywhere?
NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?
Get the Answers Now!You will get a detailed answer to your question or assignment in the shortest time possible.
Here's the Solution to this Question
#include <iostream>
#include <cmath>
using namespace std;
int main() {
int numbers[5];
for(int i=0;i<5;i++){
cin>>numbers[i];
}
//Add the 1st and 2nd integers together and store the sum inside a variable.
int sum12=numbers[0]+numbers[1];
//Add the 3rd and 4th integers together and store the sum inside a variable.
int sum34=numbers[2]+numbers[3];
//Multiply the two sums and raise the product result to the power of the 5th integer.
long int product=sum12*sum34;
long int result=pow(product,numbers[4]*1.0);
//Print out the result.
cout<<result<<"\n\n";
system("pause");
return 0;
}