Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "stdafx.h"
- #include <iostream>
- #include <math.h>
- #include <string>
- using namespace std;
- int _tmain(int argc, _TCHAR* argv[])
- {
- setlocale(0,"rus");
- string s;
- int i, k = 0, p1=0 ,p2=0,d=-1, max = -1;
- getline(cin, s);
- for (i=0;i<s.length();i++)
- {
- if (s[i]!=' ')
- {
- d++;
- if (s[i]=='t')
- k++;
- if (k>max)
- {
- max=k;
- p1=i-d;
- p2=i;
- }
- }
- else
- {
- k=0;
- d=-1;
- }
- }
- for(i=p1;i<=p2;i++)
- {
- cout<<s[i];
- }
- cout<<endl;
- cout<<"Кол-во букв T встречающихся в слове = "<<max<<endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement