纠错C语言中的调用问题

来源:百度知道 编辑:UC知道 时间:2024/06/01 12:53:11
#include <stdio.h>
#include <stdlib.h>
#define ALL_NUMBER 40

int Order(int order[ALL_NUMBER][2]);

int main()
{
int number_score[ALL_NUMBER][2];
int n,i=0;
int j=0;
int q=0;

printf("please input the number of the competitors");
scanf("%d",&n);

printf("please input the number and the score ");

for (i=0;i<=n-1;i++)
{
for (j=0;j<=1;j++)
{
scanf("%d",&number_score[i][0]);
scanf("%d",&number_score[i][1]);
}
}

Order(number_score,n);

for(q=0;q<=n-1;q++)
{
printf("%d,%d\n",number_score[q][0],number_score[q][1]);
}
return 0;

}

int Order(int order[][2],int n)
{
int number=0;
int score=0;
int i=0,j=0;

#include <stdio.h>
#include <stdlib.h>
#define ALL_NUMBER 40

int Order(int order[ALL_NUMBER][2]); 此处定义函数传一个参数,参数
类型为int 数组
int main()
{
int number_score[ALL_NUMBER][2];
int n,i=0;
int j=0;
int q=0;

printf("please input the number of the competitors");
scanf("%d",&n);

printf("please input the number and the score ");

for (i=0;i<=n-1;i++)
{
for (j=0;j<=1;j++)
{
scanf("%d",&number_score[i][0]);
scanf("%d",&number_score[i][1]);
}
}

Order(number_score,n); 此处调用传了两个参数 出错

for(q=0;q<=n-1;q++)
{
printf("%d,%d\n",number_score[q][0],number_score[q][1]);
}
return 0;

}

int Order(int order[][2],int n)
{
int number=0;
int score=0;
int i=0,