Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int bukva(char i)
- {
- if ((i<'A') || ((i>'Z')&&(i<'a')) || (i>'z'))
- return 0;
- return 1;
- }
- void poz_max_slova(char stroka[],int&simvol_do_slova,int&simvol_posle_slova)
- {
- int i=0;
- int simvol_do_slova_new=0;
- while (stroka[i]!=0)
- {
- if (bukva(stroka[i])==0)
- simvol_do_slova_new=i;
- if (i-simvol_do_slova_new>simvol_posle_slova-simvol_do_slova)
- {
- simvol_do_slova=simvol_do_slova_new;
- simvol_posle_slova=i;
- }
- i++;
- }
- }
- void vivod_slova(char stroka[],int probel_do_slova,int&probel_posle_slova)
- {
- for (int i=0;i<=probel_posle_slova-probel_do_slova;i++)
- {
- if (bukva(stroka[probel_do_slova+i])==1)
- cout<<stroka[probel_do_slova+i];
- }
- }
- int main()
- {
- char stroka[100];
- int prdoslova=0;
- int prposlslova=0;
- cin.getline(stroka,100);
- poz_max_slova(stroka,prdoslova,prposlslova);
- vivod_slova(stroka,prdoslova,prposlslova);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement