這個(gè)為什么不行?
int MAX(int score[])
{
? ? int i ,max;
? ? max=score[0];
? ? for(i=0;i<10;i++)
? ? {
? ? ? ? if(score[i]>max)
? ? ? ? {
? ? ? ? max=score[i];
? ? ? ?
? ? ? ? }
? ? ? ? return max;
? ? }
? ??
? ? ?printf("max=%d\n",max);?
? ??
}
int MAX(int score[])
{
? ? int i ,max;
? ? max=score[0];
? ? for(i=0;i<10;i++)
? ? {
? ? ? ? if(score[i]>max)
? ? ? ? {
? ? ? ? max=score[i];
? ? ? ?
? ? ? ? }
? ? ? ? return max;
? ? }
? ??
? ? ?printf("max=%d\n",max);?
? ??
}
2019-02-20
舉報(bào)
2019-05-10
返回位置錯(cuò)了,在for外才對(duì)