Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- #define endl "\n"
- int main(void) {
- string str, smax, tmax;
- getline(cin, str);
- for (char c : str) {
- if (c != 0x20)
- tmax.push_back(c);
- else {
- if (tmax.size() > smax.size())
- smax = tmax;
- tmax.clear();
- }
- }
- if (tmax.size() > smax.size())
- smax = tmax;
- cout << smax << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement