#include <iostream>
using namespace std;
int main()
{
double a[] = { 1.2, 1.7, 3.5, 1.6, 4.9, 2.1 };
double b[] = { 9.2, 7.8, 8.3, 3.5, 5.7, 7.3 };
const int xLength = 6;
double x[xLength];
for (int i = 0; i < xLength; i++) {
x[i] = (a[i] + b[i]) / 3 - 1 / 4 * sqrt(a[i] * b[i]);
cout << x[i] << " ";
}
cout << endl;
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
using namespace std;
int main()
{
double a[] = { 1.2, 1.7, 3.5, 1.6, 4.9, 2.1 };
double b[] = { 9.2, 7.8, 8.3, 3.5, 5.7, 7.3 };
const int xLength = 6;
double x[xLength];
for (int i = 0; i < xLength; i++) {
x[i] = (a[i] + b[i]) / 3 - 1 / 4 * sqrt(a[i] * b[i]);
cout << x[i] << " ";
}
cout << endl;
return 0;
}