error C2061: syntax error : identifier 'Percent'(Percent是定义的一个函数)
执行 cl.exe 时出错.
代码:
#include
#include
#define M 1000000
#define N 30
void Percent(char a[][N],int b[],int n);
void Array_Print(char a[][N],int b[],int n);
int main()
{
int i,j,len,count[M];
char tree[M][N];
printf("Input the tree:");
do{
i = 0;
scanf("%s",&tree[i]);
while(len>30)
{
printf("Input error,please again:\n");
scanf("%s",&tree[i]);
}
i++;
}
Percent(tree,count,i);
Array_Print(tree,count,i);
return 0;
}
void Percent(char a[][N],int b[],int n)
{
int i,j,k,count;
char str[N];
for(i = 0;a[i]!='\0';i++)
{
k = i;
count = 0;
for(j = i+1;a[j]!='\0';j++)
{
if(strcmp(a[k],a[j])>=0)
k = j;
else if(strcmp(a[k],a[j]) == 0)
count++;
}
strcpy(str,a[k]);
strcpy(a[k],a[i]);
strcpy(a[i],str);
b[i] = count;
}
}
void Array_Print(char a[][N],int b[],int n)
{
int i;
for(i = 0;a[i]!='\0';i++)
{
printf("%s\t%f",a[i],b[i]/n*100);
}
}