运行下面两个程序为什么它的运行结果会不同,求大神解决
#include
#include
#include
#include
void gotoxy(int x, int y)//定位光标
{
COORD pos;
pos.X = x * 2;
pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
int main(void)
{
using std::cout;
int x=0;
while(x
{
x=x+2;
gotoxy(x,14);
cout
}
cout
system("pause");
return 0;
}
#include
#include
#include
#include
void gotoxy(int x, int y)//定位光标
{
COORD pos;
pos.X = x * 2;
pos.Y = y;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), pos);
}
int main(void)
{
int x=0;
while(x<20)
{
x=x+2;
gotoxy(x,14);
cout<<"*";
}
cout<<endl;
system("pause");
return 0;
}