c语言函数不接受一个参数。 20
#include"stdafx.h"#pragmawarning(disable:4996)#defineN10voidchuli(){inti,j,temp,bijia...
#include "stdafx.h"
#pragma warning(disable:4996)
#define N 10
void chuli()
{
int i,j,temp,bijiao[N];
int max;
for (i = 0; i <= 8; i++)
{
max = i;
for (j = i + 1; j <= 9; j++)
if (bijiao[max] < bijiao[j])
max = j;
temp = bijiao[i]; bijiao[i] = bijiao[max]; bijiao[max] = temp;
}
}
int main()
{
int i, chengji[N];
for (i = 0; i <= 9; i++)
{
printf("十个学生成绩:");
scanf("%d",&chengji[i]);
}
chuli(chengji);
for (i = 0; i <= 9; i++)
{
printf("%d", chengji[i]);
printf("\n");
}
return 0;
}
//error C2660: “chuli”: 函数不接受 1 个参数
据说是参数未声明,求dalao解答如何定义参数 展开
#pragma warning(disable:4996)
#define N 10
void chuli()
{
int i,j,temp,bijiao[N];
int max;
for (i = 0; i <= 8; i++)
{
max = i;
for (j = i + 1; j <= 9; j++)
if (bijiao[max] < bijiao[j])
max = j;
temp = bijiao[i]; bijiao[i] = bijiao[max]; bijiao[max] = temp;
}
}
int main()
{
int i, chengji[N];
for (i = 0; i <= 9; i++)
{
printf("十个学生成绩:");
scanf("%d",&chengji[i]);
}
chuli(chengji);
for (i = 0; i <= 9; i++)
{
printf("%d", chengji[i]);
printf("\n");
}
return 0;
}
//error C2660: “chuli”: 函数不接受 1 个参数
据说是参数未声明,求dalao解答如何定义参数 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询