Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- #include <random>
- #include <vector>
- #include <fstream>
- using namespace std;
- string min(string a, string b, string c)
- {
- if (a < b && a < c)return a;
- if (b < a && b < c) return b;
- return c;
- }
- double min(vector<double> numbers)
- {
- double a = numbers[0];
- for (int i = 1; i < numbers.size(); i++)
- {
- if (a > numbers[i])
- a = numbers[i];
- }
- return a;
- }
- int main()
- {
- string a, b, c;
- cin >> a >> b >> c;
- string minStr = min(a, b, c);
- cout << minStr << endl;
- ifstream file("zzz.txt");
- vector<double> nums;
- double number = 0;
- while (file >> number)
- {
- nums.push_back(number);
- }
- double minVal = min(nums);
- cout << minVal;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement