Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- int main() {
- string s;
- int x = 0, y = 0;
- cin >> s;
- for (int i = 0; s[i] < s.size(); ++i) {
- if (s[i] == 'n') {
- --y;
- }
- if (s[i] == 's') {
- ++y;
- }
- if (s[i] == 'o') {
- --x;
- }
- if (s[i] == 'n') {
- ++x;
- }
- }
- cout << "(" << x << ", " << y << ")" << endl;
- }
- //g++ P79784.cpp -o P79784.exe && P79784.exe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement