-
Notifications
You must be signed in to change notification settings - Fork 55
none #167
New issue
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
Open
Comyn-Echo
wants to merge
2
commits into
TECHF5VE:master
Choose a base branch
from
Comyn-Echo:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
none #167
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
| #include<stdio.h> | ||
| #include<stdlib.h> | ||
| void merge(int* a, int m, int* b, int n) | ||
| { | ||
| int i = m - 1, j = n - 1; | ||
| int k = m + n - 1; | ||
| while (i >= 0 && j >= 0) | ||
| { | ||
| if (a[i] >= b[j]) | ||
| { | ||
| a[k--] = a[i]; | ||
| i--; | ||
| } | ||
| else | ||
| { | ||
| a[k--] = b[j]; | ||
| j--; | ||
| } | ||
| } | ||
| while (j >= 0) | ||
| { | ||
| a[k--] = b[j]; | ||
| j--; | ||
| } | ||
| } | ||
| int main() | ||
| { | ||
| int a[] = { 1,2,3,0,0,0 }; | ||
| int b[] = { 2,5,6 }; | ||
| merge(a, 3, b, 3); | ||
| for (int i = 0; i < 6; i++) | ||
| printf("%d", a[i]); | ||
| system("pause"); | ||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| #include<stdio.h> | ||
| void rotate(int** matrix, int n) | ||
| { | ||
| int i, j; | ||
| for (i = 1; i <= n; i++) | ||
| { | ||
| for (j = 1; j <= n; j++) | ||
| { | ||
| matrix[j][n - i + 1]; | ||
| printf_s("%d", matrix[j][n - i + 1]); | ||
| printf_s("\n"); | ||
| } | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| #include<stdio.h> | ||
| void traversal1(int* a, int n) | ||
| { | ||
| int echo[i]; | ||
| a = echo; | ||
| for (n = 1; n <= i; n++) | ||
| printf_s("echo[%d]=%d\n", n, *(a + n)) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #include<stdio.h> | ||
| #include<stdlib.h> | ||
| int* createArray(int n) | ||
| { | ||
| int* a; | ||
| int* a = (int*)malloc(sizeof(int) * n); | ||
| scanf_s("%d", &n); | ||
| int i(1); | ||
| for (; i <= n; i++) | ||
| { | ||
| a[i] = i; | ||
| printf_s("%d", a[i]); | ||
| } | ||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| #include<stdio.h> | ||
| #include<stdlib.h> | ||
| int** createArray(int n, int m) | ||
| { | ||
| int** a; | ||
| int i, j; | ||
| a = (int**)malloc(sizeof(long int) * n); | ||
| for (i = 1; i <= m; i++) | ||
| { | ||
| for (j = 1; j <= n; j++) | ||
| { | ||
| a[i][j] = i * m - m + j; | ||
| printf_s("%d", a[i][j]); | ||
| } | ||
| printf_s("\n"); | ||
| } | ||
| return 0; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 按题目要求请将创建好的数组返回 |
||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| #include<stdio.h> | ||
| int combination(int n, int m) | ||
| { | ||
| if (n == 1 && m == 1) return 1; | ||
| else if (n == 1 && m == 0) return 1; | ||
| else return combination(n - 1, m - 1) + combination(n - 1, m); | ||
| } | ||
| int main() | ||
| { | ||
| printf_s("Enter a number:"); | ||
| int n, sum, t, i, a(0); | ||
| scanf_s("%d", &n); | ||
| if (n % 2 == 0) | ||
| { | ||
| sum = 0; | ||
| for (i = 0; i <= n / 2; i++) | ||
| { | ||
| t = combination(n / 2, i); | ||
| sum += t; | ||
| } | ||
| } | ||
|
|
||
| else | ||
| { | ||
| for (i = 0; i <= n / 2; i++) | ||
| { | ||
| sum = 0; | ||
| t = combination(n / 2, i); | ||
| t += (t + 1); | ||
| sum += t; | ||
| } | ||
| } | ||
| printf_s("%d", sum); | ||
| return 0; | ||
| } | ||
|
|
||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # 阴雨,考试,忙碌 | ||
| ##### 关于第二次作业的总结 | ||
| 这两周事情都很多,高数的期中考试,英语四级的口语考试,两套英语四级卷子,一套雅思试卷,1500字军事理论,高数做也做不完的习题。 | ||
| 上面的这些内容表面上是抱怨,实则我想说,忙碌可以证明自己的存在感,也顺便解释一下这次任务交的比较晚的原因。 | ||
| 对于数组,指针,我是属于零基础,在刚上手的时候,完全属于不知所措,看到题目有自己的想法之后,也有一些相关的语句,语法是自己所不知道的,也借助了百度的帮忙。也就只有第六题寻求了一下安慰。 | ||
| 那么话归正题,这一次作业给我的经验就是要在完成任务之前,要了解相关的知识,我在这里说的知识是更进一步的知识,更基础的知识,一些铺垫性质的知识,这样才能更好去完成任务。 | ||
|
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里是想做什么