Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <string>
- #include <algorithm>
- #include <vector>
- using namespace std;
- bool cmp(vector<int> a, vector<int> b) {
- if (a.size() > b.size()) {
- return true;
- } else if (a.size() < b.size()) {
- return false;
- } else {
- int i = 0;
- while (i < a.size() && a[i] == b[i]) i++;
- if (i == a.size() || a[i] > b[i]) {
- return true;
- } else {
- return false;
- }
- }
- }
- vector<int> minV(vector<int> a, vector<int> b) {
- if (cmp(a, b)) {
- return b;
- } else {
- return a;
- }
- }
- vector<int> maxV(vector<int> a, vector<int> b) {
- if (cmp(a, b)) {
- return a;
- } else {
- return b;
- }
- }
- int main()
- {
- vector<int> a, b, c;
- string s;
- getline(cin, s);
- long long d = 0;
- while (s[d] != ' ') {
- a.push_back(s[d] - '0');
- d++;
- }
- d++;
- while (s[d] != ' ') {
- b.push_back(s[d] - '0');
- d++;
- }
- d++;
- while (d < s.length()) {
- c.push_back(s[d] - '0');
- d++;
- }
- vector<int> ans = maxV( maxV(a, b), c );
- for (int i = 0; i < ans.size(); i++) {
- cout << ans[i];
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement