Advertisement
Guest User

2813

a guest
Jan 22nd, 2020
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include<iostream>
  2. #include<cstring>
  3. using namespace std;
  4. int main()
  5. {
  6. int cate=0;
  7. char s[256],*p;
  8. cin.getline(s,256);
  9. p=strtok(s," ");
  10. cate=0;
  11. while(p!=0)
  12. {
  13. if(strstr(p,"DO") || strstr(p,"RE") || strstr(p,"MI") || strstr(p,"FA") || strstr(p,"SOL") || strstr(p,"LA") || strstr(p,"SI"))
  14. {
  15. cate++;
  16. cout<<p<<endl;
  17. }
  18. p=strtok(0," ");
  19. }
  20. if(cate==0)
  21. {
  22. cout<<"nu exista";
  23. }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement