Untitled
#include <vector> #include <iostream> #include <fstream> using namespace std; int main() { ifstream in("soundin.txt"); int n; vector<float> sound; int i; float down, up; in >> down; in >> up; float a; while (in) { in >> a; sound.push_back(a); } for (i = 0; i < sound.size(); i++) { if (sound[i] < down) sound[i] = down; if (sound[i] > up) sound[i] = up; } for (i = 0; i <sound.size()-1; i++) { cout << sound[i] << ' '; } }