Untitled

mail@pastecode.io avatar
unknown
plain_text
8 months ago
451 B
0
Indexable
Never
#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;

    }
    
}