Advertisement
ann111

4b

Jul 20th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.50 KB | None | 0 0
  1. int main()
  2. {
  3.     char a[40];
  4.     int b,c,d,e,max;
  5.     b=c=d=e=max=0;
  6.     cout << "vvedite stroku: ";
  7.     cin.getline(a,40);
  8.     while (a[b]!='\0')
  9.     {
  10.         while (a[b]>='A' && a[b]<='Z' || a[b]>='a' && a[b]<='z')
  11.         {
  12.             b=b+1;
  13.             c=c+1;
  14.             d=b;
  15.         }
  16.         if (c>max)
  17.         {
  18.             max=c;
  19.             e=d-max;
  20.         }
  21.         c=0;
  22.         b=b+1;
  23.     }
  24.    while (c<max)
  25.    {
  26.        cout << a[e];
  27.        e=e+1;
  28.        c=c+1;
  29.    }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement