Commit a8b7d86b authored by Michael's avatar Michael

michael.davityan:exercise_07_40v7

parent 45eabe02
5
1
3
2
4
12
34
-3
7
9
5
11.25
-13.45
-12.64
23.7
1.56
5
11.5
34.2
23.7
45.65
7.5
6
acdbes
badce
......@@ -46,43 +46,42 @@ inputCharVector(std::vector<char> &vector, const int sizeOfVector)
int
main()
{
const int BUFFER_SIZE = 10;
if (::isatty(STDIN_FILENO)) {
std::cout << "Insert integers vector size and elements(size must be <= 10).\n" << "size: ";
std::cout << "Insert integers vector size and elements.\n" << "size: ";
}
int integersVectorSize;
std::cin >> integersVectorSize;
if (integersVectorSize > BUFFER_SIZE) {
std::cerr << "Error 1: size must be less or equal than 10.\n";
if (integersVectorSize < 0) {
std::cerr << "Error 1: size must be more than zero.\n";
return 1;
}
std::vector<int> integersVector(BUFFER_SIZE);
std::vector<int> integersVector(integersVectorSize);
inputNumericVector(integersVector, integersVectorSize);
std::cout << "Minimum is: " << recursiveMinimum(integersVector, integersVectorSize - 1);
std::cout << std::endl;
if (::isatty(STDIN_FILENO)) {
std::cout << "Insert floating numbers vector size and elements(size must be <= 10).\n" << "size: ";
std::cout << "Insert floating numbers vector size and elements.\n" << "size: ";
}
int floatingVectorSize;
std::cin >> floatingVectorSize;
if (floatingVectorSize > BUFFER_SIZE) {
std::cerr << "Error 1: size must be less or equal than 10.\n";
if (floatingVectorSize < 0) {
std::cerr << "Error 1: size must be more than zero.\n";
return 1;
}
std::vector<double> floatingVector(BUFFER_SIZE);
std::vector<double> floatingVector(floatingVectorSize);
inputNumericVector(floatingVector, floatingVectorSize);
std::cout << "Minimum is: " << recursiveMinimum(floatingVector, floatingVectorSize - 1);
std::cout << std::endl;
if (::isatty(STDIN_FILENO)) {
std::cout << "Insert characters vector size and elements(size must be <= 10).\n" << "size: ";
std::cout << "Insert characters vector size and elements.\n" << "size: ";
}
int charactersVectorSize;
std::cin >> charactersVectorSize;
if (charactersVectorSize > BUFFER_SIZE) {
std::cerr << "Error 1: size must be less or equal than 10.\n";
if (charactersVectorSize < 0) {
std::cerr << "Error 1: size must be more than zero.\n";
return 1;
}
std::vector<char> charactersVector(BUFFER_SIZE);
std::vector<char> charactersVector(charactersVectorSize);
inputCharVector(charactersVector, charactersVectorSize);
std::cout << "Minimum is: " << recursiveMinimum(charactersVector, charactersVectorSize - 2);
std::cout << std::endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment