教程参考
2023.3申请github copilot x 学生认证以及Jetbrain专业版学生教育免费教程
1:修改个人信息
Github右上角头像点击 Your profile
Name:改成你的英文名字,例如 Li Mingtian
Bio:I am Li Mingtian, a student in xxx university. I want to study in Github and try to make some contributions to the community.
Company:Xxx University
Location:Xxx University
2:准备材料
3:提交材料
- 用手机(不要用电脑)打开Github学生认证网址https://education.github.com/discount_requests/application(注意千万不要科学上网!!!)
- 然后这样填:
- 邮箱:随便选一个
- 学校:直接中文输入你的学校名字,然后选择弹出来的学校信息
- 理由:I want to study in Github and try to make some contributions to the community.
- 选continue,允许获取位置
- 手机选上传照片,上传step2的jpeg图片
- type选transcript,提交
4:等待邮箱结果


5:Github Copilot
- 打开https://github.com/features/copilot
- 点击Start my free trial
- 安装vscode github copilot插件,登录验证就可以用了~


6:使用技巧
写注释回车即可
【Github Copilot 使用】
点击查看【bilibili】
class test {// 写一个冒泡排序public int[] effervescence(int arr[]) {int temp = 0;for (int i = 0; i < arr.length; i++) {for (int j = 0; j < arr.length - i - 1; j++) {if (arr[j] > arr[j + 1]) {temp = arr[j];arr[j] = arr[j + 1];arr[j + 1] = temp;}}}return arr;}// 写一个选择排序public int[] select(int arr[]) {int temp = 0;int minIndex = 0;for (int i = 0; i < arr.length; i++) {minIndex = i;for (int j = i; j < arr.length; j++) {if (arr[minIndex] > arr[j]) {minIndex = j;temp = arr[minIndex];arr[minIndex] = arr[i];arr[i] = temp;}}}return arr;}// 写一个插入排序public int[] insert(int arr[]) {int temp = 0;int insertIndex = 0;for (int i = 1; i < arr.length; i++) {insertIndex = i - 1;temp = arr[i];while (insertIndex >= 0 && temp < arr[insertIndex]) {arr[insertIndex + 1] = arr[insertIndex];insertIndex--;}arr[insertIndex + 1] = temp;}return arr;}// 写一个希尔排序public int[] shell(int arr[]) {int temp = 0;int insertIndex = 0;for (int gap = arr.length / 2; gap > 0; gap /= 2) {for (int i = gap; i < arr.length - gap; i++) {insertIndex = i - gap;temp = arr[i];while (insertIndex >= 0 && temp < arr[insertIndex]) {arr[insertIndex + gap] = arr[insertIndex];insertIndex -= gap;}arr[insertIndex + gap] = temp;}}return arr;}// 写一个快速排序public int[] quick(int arr[], int left, int right) {int l = left;int r = right;int pivot = arr[(left + right) / 2];int temp = 0;while (l < r) {while (arr[l] < pivot) {l++;}while (arr[r] > pivot) {r--;}if (l >= r) {break;}temp = arr[l];arr[l] = arr[r];arr[r] = temp;if (arr[l] == pivot) {r--;}if (arr[r] == pivot) {l++;}}if (l == r) {l++;r--;}if (left < r) {quick(arr, left, r);}if (right > l) {quick(arr, l, right);}return arr;}// 写一个归并排序public int[] merge(int arr[], int left, int right) {if (left < right) {int mid = (left + right) / 2;merge(arr, left, mid);merge(arr, mid + 1, right);mergeSort(arr, left, mid, right);}return arr;}// 归并排序的合并public void mergeSort(int arr[], int left, int mid, int right) {int temp[] = new int[right - left + 1];int l = left;int r = mid + 1;int index = 0;while (l <= mid && r <= right) {if (arr[l] < arr[r]) {temp[index] = arr[l];l++;index++;} else {temp[index] = arr[r];r++;index++;}}while (l <= mid) {temp[index] = arr[l];l++;index++;}while (r <= right) {temp[index] = arr[r];r++;index++;}for (int i = 0; i < temp.length; i++) {arr[left + i] = temp[i];}}// 写一个基数排序public int[] radix(int arr[]) {int max = arr[0];for (int i = 0; i < arr.length; i++) {if (max < arr[i])max = arr[i];}int maxLength = (max + "").length();int bucket[][] = new int[10][arr.length];int bucketElementCounts[] = new int[10];int index = 0;for (int i = 0, n = 1; i < maxLength; i++, n *= 10) {for (int j = 0; j < arr.length; j++) {index = arr[j] / n % 10;bucket[index][bucketElementCounts[index]] = arr[j];bucketElementCounts[index]++;}int k = 0;for (int j = 0; j < bucketElementCounts.length; j++) {if (bucketElementCounts[j] != 0) {for (int l = 0; l < bucketElementCounts[j]; l++) {arr[k] = bucket[j][l];k++;}}bucketElementCounts[j] = 0;}}return arr;}// 写一个堆排序public int[] heap(int arr[]) {int temp = 0;for (int i = arr.length / 2 - 1; i >= 0; i--) {heapSort(arr, i, arr.length);}for (int i = arr.length - 1; i > 0; i--) {temp = arr[i];arr[i] = arr[0];arr[0] = temp;heapSort(arr, 0, i);}return arr;}// 堆排序的调整public void heapSort(int arr[], int i, int length) {int temp = arr[i];for (int k = i * 2 + 1; k < length; k = k * 2 + 1) {if (k + 1 < length && arr[k] < arr[k + 1]) {k++;}if (arr[k] > temp) {arr[i] = arr[k];i = k;} else {break;}}arr[i] = temp;}// 写一个计数排序public int[] count(int arr[]) {int max = arr[0];int min = arr[0];for (int i = 0; i < arr.length; i++) {if (max < arr[i])max = arr[i];if (min > arr[i])min = arr[i];}int count[] = new int[max - min + 1];for (int i = 0; i < arr.length; i++) {count[arr[i] - min]++;}int index = 0;for (int i = 0; i < count.length; i++) {while (count[i] > 0) {arr[index] = i + min;index++;count[i]--;}}return arr;}// 写一个希尔排序public int[] shell(int arr[]) {int temp = 0;for (int gap = arr.length / 2; gap > 0; gap /= 2) {for (int k = gap; k < arr.length; k++) {for (int i = k - gap; i >= 0; i -= gap) {if (arr[i] > arr[i + gap]) {temp = arr[i];arr[i] = arr[i + gap];arr[i + gap] = temp;}}}}return arr;}// 写一个桶排序public int[] bucket(int arr[]) {int max = arr[0];int min = arr[0];for (int i = 0; i < arr.length; i++) {if (max < arr[i])max = arr[i];if (min > arr[i])min = arr[i];}int bucketSize = 5;int bucketCount = (max - min) / bucketSize + 1;ArrayList<ArrayList<Integer>> bucket = new ArrayList<ArrayList<Integer>>();for (int i = 0; i < bucketCount; i++) {bucket.add(new ArrayList<Integer>());}for (int i = 0; i < arr.length; i++) {bucket.get((arr[i] - min) / bucketSize).add(arr[i]);}int index = 0;for (int i = 0; i < bucket.size(); i++) {Collections.sort(bucket.get(i));for (int j = 0; j < bucket.get(i).size(); j++) {arr[index] = bucket.get(i).get(j);index++;}}return arr;}// 写一个基数排序public int[] effervescence(int arr[]) {int temp = 0;boolean flag = false;for (int i = 0; i < arr.length - 1; i++) {flag = false;for (int k = 0; k < arr.length - 1 - i; k++) {if (arr[k] > arr[k + 1]) {temp = arr[k];arr[k] = arr[k + 1];arr[k + 1] = temp;flag = true;}}if (!flag)break;}return arr;}public static void main(String[] args){int[] name = new int[5];name[0] = 1;name[1] = 54325;name[2] = 7474;name[3] = 546;name[4] = 77;test test = new test();int[] effervescence = test.effervescence(name);for(int i = 0; i < effervescence.length; i++){System.out.println(effervescence[i]);}System.out.println("Hello World");}}
IDEA
重启IDEA


