We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
int FindNoMin(int A[],int n) { int *B,i; B=(int*)malloc(sizeof(int)*n);//为数组申请内存空间 for(i=0;i<n;i++) B[i]=0;//将数组初始化都为0 for(i=0;i<n;i++) if(A[i]>0&&A[i]<=n)//若A属于0~n之间,标记B B[A[i]-1]=1; for(i=0;i<n;i++)//扫描计数数组,找到目标值 if(B[i]==0) break; return i+1; }
The text was updated successfully, but these errors were encountered:
是的,当时确实考虑不周,不过该代码不影响考试和解题思路,谢谢指正,我有空会更新文档的
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: