Untitled

 avatar
unknown
plain_text
2 years ago
451 B
4
Indexable
#include <iostream>
using namespace std;

int main()
{
    setlocale(LC_ALL, "Russian");
    int key;
    int y=0, x=0;
    cin >> key; 
    switch (key)
    {
        case ('W'):
            cout << y++;
            break;
        case ('S'):
            cout << y--;
            break;
        case 'D':
            cout << x++;
            break;
        case 'A':
            cout << x--;
            break;

    }
    
}
Editor is loading...