Advertisement
a53

Smiley

a53
Jul 28th, 2017
243
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <fstream>
  2. #include <cstring>
  3. using namespace std;
  4. ifstream cin("smiley.in");
  5. ofstream cout("smiley.out");
  6. char c;
  7. int main()
  8. {
  9. int ns=0;
  10. c=cin.get();
  11. while (c>0)
  12. {
  13. if (strchr(":;>8", c))
  14. {
  15. while (strchr(":;>8", c))
  16. {
  17. c=cin.get();
  18. if (c=='-')
  19. {
  20. while (c=='-') c=cin.get();
  21. if (strchr("()[]DPOX3", c)) ns++;
  22. }
  23. else
  24. {
  25. if (strchr("()[]DPOX3", c)) ns++;
  26. }
  27. }
  28. }
  29. else c=cin.get();
  30. }
  31. cout << ns;
  32. return 0;
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement