Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <fstream>
- #include <cstring>
- using namespace std;
- ifstream cin("smiley.in");
- ofstream cout("smiley.out");
- char c;
- int main()
- {
- int ns=0;
- c=cin.get();
- while (c>0)
- {
- if (strchr(":;>8", c))
- {
- while (strchr(":;>8", c))
- {
- c=cin.get();
- if (c=='-')
- {
- while (c=='-') c=cin.get();
- if (strchr("()[]DPOX3", c)) ns++;
- }
- else
- {
- if (strchr("()[]DPOX3", c)) ns++;
- }
- }
- }
- else c=cin.get();
- }
- cout << ns;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement