Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main()
- {
- char str[256]="";
- int i;
- int d;
- for(i=0;i<256;i++)
- {
- if(str[i]!=' ')
- {
- d++;
- }
- }
- cout << "Wwedi stroku :";
- cin.getline (str,256);
- int now=0, max=0,id;
- for(i=0;i<d;i++)
- {
- if(str[i]>='A'&&str[i]<='z')
- {
- now=now+1;
- }
- else
- {
- if (now>max)
- {
- max=now;
- id=i-now;
- }
- now=0;
- }
- }
- cout << "Dlina slova : " <<max << endl;
- cout << "Slovo : ";
- max=max+id;
- for(;id<max;id++)
- {
- cout << str[id];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement