Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- char x, max = '0' - 1, v[101]; int poz_max = -1;
- gets_s(v);
- if (v[0] >= '0' && v[0] <= '9') {
- max = v[0]; poz_max = 0;
- }
- for (int i = 1; v[i] != '\0'; i++)
- if (v[i - 1] == ' ' && v[i] >= '0' && v[i] <= '9' && max < v[i]) {
- max = v[i]; poz_max = i;
- }
- if (poz_max >= 0)
- for (int i = poz_max; v[i] >= '0' && v[i] <= '9'; i++)
- cout << v[i];
- else
- cout << "NU EXISTA";
- cout << '\n';
- system("pause");
- }
Advertisement
Add Comment
Please, Sign In to add comment