Advertisement
Petro_zzz

10_26_2

Oct 26th, 2022
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.43 KB | None | 0 0
  1. #include <iostream>
  2. #include <conio.h>
  3.  
  4. using namespace std;
  5. int main() {
  6.     setlocale(LC_ALL, "ru");
  7.     int count = 0;
  8.     char ch;
  9.     while(true) {
  10.         ch = _getch(); // вот эта функция полезная
  11.         if (ch == 'q') return 0;
  12.         else if (ch == 'w') cout << "^" << endl;           
  13.         else if (ch == 's') cout << "v" << endl;
  14.         else if (ch == 'a') cout << "<" << endl;
  15.         else if (ch == 'd') cout << ">" << endl;
  16.     }
  17.     return 0;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement