Guest User

Untitled

a guest
Feb 20th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <stdio.h>
  3. #include <stdlib.h>
  4. #include <conio.h>
  5. using namespace std;
  6. int main(int argc, char *argv[]){
  7. unsigned car=' ';
  8. do{
  9. if(car==0)car=getch()+256;
  10. {
  11. if (car==80)
  12. cout<<"down arrow"<<endl;
  13. else if (car==75)
  14. cout<<"left arrow"<<endl;
  15. else if (car==77)
  16. cout<<"right arrow"<<endl;
  17. else if (car==72)
  18. cout<<"up arrow"<<endl;
  19. }
  20. }while((car=getch())!='\033');
  21. return 0;
  22. }
Add Comment
Please, Sign In to add comment