資源簡介
冒泡排序的動態顯示過程,C語言實現
代碼片段和文件信息
#include
#include
#include
#include
#include
#define?timespan?500
int?main()
{
two:;
BubbleSort();
rewind(stdin);
getchar();
goto?two;
return?0;
}
int?swap(int?*xint?*y)
{
int?temp;
if?(*x?>?*y)?{?temp?=?*x?*x?=?*y?*y?=?temp;?}
return?0;
}
int?Gotoxy(int?x?int?y)
{
HANDLE?handle;
COORD?coord;
coord.X?=?x;
coord.Y?=?y;
handle?=?GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(handle?coord);
}
void?clr_row(int?xint?y)
{
for?(int?i?=?0;?i?50;?i++)
{
printf(“?“);
}
Gotoxy(x?y);
}
void?currentpic(int?index)
{
Gotoxy(0index);
printf(“\16“);
Sleep(timespan);
}
void?clr_currentpic(int?index)
{
Gotoxy(0?index);
printf(“?“);
}
void?putpic(int?s
- 上一篇:c++ 二維碼
- 下一篇:Windows驅動開發技術詳解 源碼
評論
共有 條評論