Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cstring>
- using namespace std;
- int main()
- {
- char str[80];
- char srl[40];
- for (int i = 0; i < 40; ++i)
- srl[i] = '\0';
- gets_s(str);
- int k = 0, m = 0;
- for (int j = 0; j < strlen(str); j++)
- {
- while (!str[j] == ' ')
- {
- m++;
- }
- if (str[j] == ' ')
- {
- srl[k] = m;
- k++;
- m = 0;
- }
- }
- for (int z = 0; z < strlen(srl); z++)
- {
- int max = srl[z];
- if (max < srl[z + 1])
- {
- max = srl[z + 1];
- cout << max;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement