Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- int main()
- {
- char recenica[100];
- std::cout << "Unesi recenicu: "<<std::endl;
- std::cin.getline(recenica, sizeof recenica);
- char *pok(recenica);
- bool nasao_rijec(false);
- while(*pok!='\0' && *pok!='\n')
- {
- if(*pok==' ')
- {
- if(nasao_rijec)
- {
- do { pok++; }
- while(*pok==' ');
- if(*pok!=' ')
- {
- while(*pok!='\0' && *pok!='\n')
- {
- std::cout<<*pok;
- pok++;
- }
- }
- }
- else
- {
- pok++;
- continue;
- }
- }
- else
- {
- nasao_rijec=true;
- pok++;
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement