#include <iostream>
#include <windows.h>
#include <conio.h>
using namespace std;
int main()
{
COORD cursor = {0,0};
HANDLE outputhandle = GetStdHandle(STD_OUTPUT_HANDLE);
int i = 0;
do {
if(i<=0){
while(i < 100){
system("cls");
cursor.X = i;
cursor.Y = 10;
SetConsoleCursorPosition(outputhandle,cursor);
cout<<"Bonnary";
Sleep(10);
if(i == 100) i = 0;
i++;
}
}
else{
while(i > 0){
system("cls");
cursor.X = i;
cursor.Y = 10;
SetConsoleCursorPosition(outputhandle,cursor);
cout<<"Bonnary";
Sleep(10);
if(i == 0) i = 100;
i--;
}
}
}while(!kbhit());
return 0;
}