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
Code Review的文档请上传至ftp的Code Review/lab6 文件夹中。 首先大家先看看Lab6示例代码。 这个lab的实现方式其实非常多样,在示例代码中给出的只是一种方案。
下面这段代码也是解决Lab 6中Problem 1的一种方案(后文简称“代码2”)
public static int compare(char[] a, char[] b) { int i = 0; while (i < a.length && a[i] == '0') i++; int indexA = i; i = 0; while (i < b.length && b[i] == '0') i++; int indexB = i; if (a.length - indexA < b.length - indexB) { return -1; } else if (b.length - indexB < a.length - indexA) { return 1; } else { for (i = indexA; i < a.length; i++) { int j = i + indexB - indexA; if (a[i] > b[j]) { return 1; } else if (a[i] < b[j]) { return -1; } } } return 0; }
请大家结合示例代码、代码2以及自己的代码,回答如下几个问题:
最后重申一下:Code Review的文档请上传至ftp的Code Review/lab6 文件夹中。☘️
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Code Review的文档请上传至ftp的Code Review/lab6 文件夹中。
首先大家先看看Lab6示例代码。
这个lab的实现方式其实非常多样,在示例代码中给出的只是一种方案。
下面这段代码也是解决Lab 6中Problem 1的一种方案(后文简称“代码2”)
请大家结合示例代码、代码2以及自己的代码,回答如下几个问题:
最后重申一下:Code Review的文档请上传至ftp的Code Review/lab6 文件夹中。☘️
The text was updated successfully, but these errors were encountered: