Below is a simple C++ program that takes the number of floating-point values as input.
cpp
#include <iostream>
#include <iomanip>
#include <vector>
int main() {
// Set precision for floating-point output
std::cout << std::fixed << std::setprecision(2);
// Read the number of floating-point values
int numValues;
std::cin >> numValues;
// Read the floating-point values into a vector
std::vector<double> values(numValues);
for (int i = 0; i < numValues; ++i) {
std::cin >> values[i];
}
// Find the largest value
double max = values[0];
for (int i = 1; i < numValues; ++i) {
if (values[i] > max) {
max = values[i];
}
}
// Adjust and output the values
for (int i = 0; i < numValues; ++i) {
double adjustedValue = values[i] / max;
std::cout << adjustedValue << " ";
}
return 0;
}