數(shù)值傳遞 求大神
#include <stdio.h>?
void sort(int score[])
{
int i,j;
for(i=0;i<9;i++)
{
for(j=8;j>=i;j--)
{
if(score[j]>score[j+1])
{
int temp;
temp = score[j];
score[j] = score[j+1];?
score[j+1]=temp; ? ? ? ? ? ? ? ? ?
} ? ? ? ? ? ? ? ??
} ? ? ? ? ? ? ? ? ??
}
for(i=0;i<9;i++)
{
printf("%d ",score[i]); ? ? ? ? ? ? ??
}
? ??
}
?
int main()
{
int score[9]={1,2,3,6,8,9,98,54,564};
sort(score);
return 0;
}
這個(gè)程序沒有用指針 也可以傳遞數(shù)值 為什么
2016-03-02
你有中間變量呀