Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2018
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     string s;
  7.     int x = 0, y = 0;
  8.     cin >> s;
  9.     for (int i = 0; s[i] < s.size(); ++i) {
  10.         if (s[i] == 'n') {
  11.             --y;
  12.         }
  13.         if (s[i] == 's') {
  14.             ++y;
  15.         }
  16.         if (s[i] == 'o') {
  17.             --x;
  18.         }
  19.         if (s[i] == 'n') {
  20.             ++x;
  21.         }
  22.     }
  23.     cout << "(" << x << ", " << y << ")" << endl;
  24.  
  25. }
  26.  
  27. //g++ P79784.cpp -o P79784.exe && P79784.exe
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement