用数组!
int swapped = 1; /* 是否执行了交换 */
int num[20];
while(swapped == 1)
{
swapped = 0;
for(i = 0; i < 19; i++)
{
if(num[i] > num[i+1]) /* 小到大 */
{
swapped = 1;
tmp = num[i];
num[i] = num[i+1];
num[i+1] = tmp;
}
}
}