Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2. #define N 1001
  3.  
  4. using namespace std;
  5.  
  6. //ifstream fin("date.in");
  7. //ofstream fout("date.out");
  8.  
  9. #define ce(x) cout << x << endl;
  10. #define cs(x) cout << x << " ";
  11. #define c(x) cout << x;
  12. #define e(x) cout << endl;
  13.  
  14. #define fe(x) fout << x << endl;
  15. #define fs(x) fout << x << " ";
  16. #define f(x) fout << x;
  17. #define ef(x) fout << endl;
  18.  
  19. char s[N], sub[N], t[][4] = {"DO", "RE", "MI", "FA", "SOL", "LA", "SI"};
  20. int main()
  21. {
  22. int i, ok = 0;
  23. bool f = true;
  24. cin.getline(s, N);
  25. char *p = strtok(s, " ");
  26. while(p){
  27. int i;
  28. ok = 0;
  29. for(i = 0; i < 8 && !ok; i++)
  30. if(strstr(p, t[i])) cout << p << endl, ok = 1;
  31. p = strtok(NULL, " ");
  32. }
  33.  
  34. return 0;
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement