C语言程序设计(运用二维数组、冒泡排序等)
来源:百度知道 编辑:UC知道 时间:2024/06/01 09:10:43
#include <stdio.h>
#include <malloc.h>
int main()
{
int **mark_table,n,m,*placing;
double *last_mark;
int i,j,k;
printf("Please input the number of players:");
scanf("%d",&n);
printf("\nPlease input the number of raters:");
scanf("%d",&m);
mark_table = (int **)malloc(n*sizeof(int *));
for(i = 0; i < n; i++)
*(mark_table+i) = (int *)malloc(m*sizeof(int));
last_mark = (double *)malloc(n*sizeof(double));
placing = (int *)malloc(n*sizeof(int));
printf("\nPlease input the marks of players:");
for(i = 0; i < n ; i++)
{
printf("\nPlease input the %dth player marks:\n",i+1);
printf("From rater 1 to rater %d :\n",m);
for(j = 0; j < m; j++)
scanf("%d",*(mark_table+i)+j);
}
for(i = 0; i < n; i++)
{
int max,min