Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void main(){
- int i=0;
- char str2[255],str1[256]=" ";
- cout<<"Vvedite stroky\n";
- cin.getline(str2,255);
- strcat(str1, str2);
- char *pstr = str1;
- int n = 0;
- while((pstr = strstr(pstr," end "))!=NULL)
- {
- n++;
- pstr+=5;
- }
- pstr = str1;
- while((pstr = strstr(pstr," or "))!=NULL)
- {
- n++;
- pstr+=4;
- }
- cout<<"\n"<<n<<" raza\n";
- cin>>n;
- }
Add Comment
Please, Sign In to add comment