Guest User

Untitled

a guest
Mar 13th, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. #include <iostream>
  2. using namespace std;
  3. void main(){
  4. int i=0;
  5. char str2[255],str1[256]=" ";
  6. cout<<"Vvedite stroky\n";
  7. cin.getline(str2,255);
  8. strcat(str1, str2);
  9. char *pstr = str1;
  10. int n = 0;
  11. while((pstr = strstr(pstr," end "))!=NULL)
  12. {
  13. n++;
  14. pstr+=5;
  15. }
  16. pstr = str1;
  17. while((pstr = strstr(pstr," or "))!=NULL)
  18. {
  19. n++;
  20. pstr+=4;
  21. }
  22. cout<<"\n"<<n<<" raza\n";
  23. cin>>n;
  24. }
Add Comment
Please, Sign In to add comment