10个数字按顺序排列

这是前几天写的,今天乍一看,竟然不太认识。前昨今天都在为小狗而与PERL语言搏斗,3天没怎么写代码,没想到竟如此疏离。每天至少20分钟写代码保持手感,诚不欺我。
``

include

include

int main()
{
int ordinary[10];
for (int i = 0; i < 10; i++)
{
printf("qing shuru :");
scanf_s("%d", &ordinary[i]);
printf("ordinary[%d] yi shuru\n", i);
}

int max[10];
for (int i = 0; i < 10;i++)
{
max[i] = 0;
int num;
for (int a = 0; a < 10; a++)
{
if (ordinary[a] > max[i])
{
max[i] = ordinary[a];
num = a;
}
else
{

    }
}
for (int b = num; b < (10-i); b++)
{
    ordinary[b] = ordinary[b + 1];
}

// printf("zuidazhi wei %d,bianhao wei %d", max[i], (num + 1));
}
for (int i = 0; i < 10; i++)
{
printf("%d\n", max[i]);
}
//printf("%d", ordinary[1]);

 system("pause");
 return 0;

}
``

你可能感兴趣的:(10个数字按顺序排列)