Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //#include "pch.h"
- #include <iostream>
- #include <vector>
- using namespace std;
- #define ll long long
- double sqr(double x) {
- return (x * x);
- }
- ostream & operator << (ostream & out, vector<ll> & v) {
- for (int i = 0; i < v.size(); i++) {
- out << v[i] << ' ';
- }
- return out;
- }
- int step(ll x, int n) {
- int y = x;
- x = 1;
- for (int i = 0; i < n; i++) {
- x *= y;
- }
- return x;
- }
- void LlVec(vector<ll> &a) {
- int x = 0;
- int h = 1;
- vector<char> fc;
- char c = getchar();
- if (c != '\n' & c != -1) {
- if (c == '-') {
- h = -1;
- c = getchar();
- }
- while (c != ' ' & c != '\n' & c != -1) {
- fc.push_back(c);
- c = getchar();
- }
- int k = fc.size();
- for (int i = k - 1; i >= 0; i--) {
- x += (fc[i] - 48) * step(10, k - i - 1);
- }
- x *= h;
- a.push_back(x);
- do {
- cin >> x;
- a.push_back(x);
- c = getchar();
- } while (c != -1 & c != '\n');
- }
- }
- int main()
- {
- vector<ll> a;
- LlVec(a);
- int k = 0;
- for (int i = 0; i < a.size(); i++) {
- if ((a[i] < k | k == 0) & a[i] % 2 != 0) k = a[i];
- }
- cout << k;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement