Advertisement
tei123

gotoxy

Mar 3rd, 2016
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. #include <cstdlib>
  2. #include <iostream>
  3.  
  4. using namespace std;
  5.  
  6. #include "windows.h"
  7. void gotoxy(int x, int y)
  8. {
  9. COORD c;
  10. c.X = x - 1;
  11. c.Y = y - 1;
  12. SetConsoleCursorPosition (GetStdHandle(STD_OUTPUT_HANDLE), c);
  13. }
  14.  
  15.  
  16. int main(int argc, char *argv[])
  17. {
  18. gotoxy(10,10);
  19. cout << "sdf";
  20. int i;
  21. for(i=15;i<35;i++)
  22. {
  23. gotoxy(i,15);
  24. cout << char(205);
  25. };
  26. for(i=15;i<35;i++)
  27. {
  28. gotoxy(15,i);
  29. cout << char(205);
  30. };
  31. for(i=15;i<35;i++)
  32. {
  33. gotoxy(35,i);
  34. cout << char(205);
  35. };
  36. for(i=15;i<35;i++)
  37. {
  38. gotoxy(i,35);
  39. cout << char(205);
  40. };
  41. gotoxy(16,16);
  42. int a;
  43. cin >> a;
  44. system("PAUSE");
  45. return EXIT_SUCCESS;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement