用C++写汉字向左移动的程序问题

来源:百度知道 编辑:UC知道 时间:2024/06/03 18:06:44
我写的程序(如下)可汉字不跟着动,怎么改?
#include<iostream>
#include<windows.h>
using namespace std;
int main()
{int i;
cout<<" "<<"向左移";
for(i=15;i>=0;i--)
{cout<<"\b";
Sleep(1000);}
return 0;
}
想让汉字“向左移”向左移动

#include<iostream>
#include<windows.h>
using namespace std;
int main() {
for(int i=15;i>=0;i--) {
cout<<"\r";
for(int j=0;j<i;j++)
cout<<" ";
cout<<"向左移";
Sleep(1000);
}
cout<<endl;
return 0;
}

你是不是想这样。。
\b只能把光标左移如果不cout什么东西是不能覆盖原来的输出的
我使用\r把光标移到最左端然后输出i个空格,应该能实现你想要的功能

你想干什么?是想让汉字向左移动?还是怎么样?
你程序里只是显示”向左移”,能向左移吗?