forked from youhuangla/Note
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
704918d
commit fcca697
Showing
17 changed files
with
203 additions
and
3 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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,53 @@ | ||
# leap year | ||
|
||
## day of year | ||
|
||
![image-20220508174244755](img/image-20220508174244755.png) | ||
|
||
```c | ||
#include <stdio.h> | ||
int main() { | ||
int y, m, d; | ||
scanf("%d.%d.%d", &y, &m, &d); | ||
//printf("%d.%d.%d", y, m, d); | ||
int leap; | ||
//judge leap year | ||
if (y % 400 == 0 || (y % 4 == 0 && y % 100 != 0)) { | ||
leap = 1; | ||
} else { | ||
leap = 0; | ||
} | ||
|
||
//day of month | ||
int month[13] = {0,/*skip 0 month*/ | ||
31, 28, 31, 30, 31, 30, | ||
31, 31, 30, 31, 30, 31 | ||
}; | ||
|
||
//if you forget that the febrary of leap year should be 29,you should remenber the joke that somebody | ||
//only have a birthday every four years. | ||
|
||
//leap year impact day of month | ||
if (leap == 1) { | ||
month[2] += 1; | ||
} | ||
|
||
//count the day of year according to month | ||
int day_of_year = 0; | ||
for (int i = 1; i < m; i++) {//bug: january will not plus month[1]! | ||
day_of_year += month[i]; | ||
} | ||
|
||
//plus day of the month | ||
day_of_year += d; | ||
printf("第%d天", day_of_year); | ||
|
||
return 0; | ||
} | ||
``` | ||
|
||
```output | ||
2008.10.3 | ||
第277天 | ||
``` | ||
|
This file contains 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
Empty file.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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,66 @@ | ||
[Version Control in Visual Studio Code](https://code.visualstudio.com/docs/editor/versioncontrol) | ||
|
||
![image-20220508214746820](img/image-20220508214746820.png) | ||
|
||
![image-20220508215122770](img/image-20220508215122770.png) | ||
|
||
无脑三件套失败。。。 | ||
|
||
```shell | ||
git push | ||
fatal: No configured push destination. | ||
Either specify the URL from the command-line or configure a remote repository using | ||
|
||
git remote add <name> <url> | ||
|
||
and then push using the remote name | ||
|
||
git push <name> | ||
``` | ||
|
||
别忘记首先在 vscode 上登陆 github! | ||
|
||
![image-20220508215557397](img/image-20220508215557397.png) | ||
|
||
publish 后会弹出一个可以让你转到 github 对应的 repo 的链接。 | ||
|
||
![image-20220508220224812](img/image-20220508220224812.png) | ||
|
||
然后 | ||
|
||
<img src="img/image-20220508220108564.png" alt="image-20220508220108564" style="zoom: 50%;" /> | ||
|
||
|
||
|
||
[what is "Would you like to enable auto fetching of Git repositories?" · Issue \#40282 · microsoft/vscode](https://github.com/microsoft/vscode/issues/40282) | ||
|
||
那么先不管他们,直接用朴素的方法新建吧! | ||
|
||
![image-20220508220335740](img/image-20220508220335740.png) | ||
|
||
<img src="img/image-20220508220402535.png" alt="image-20220508220402535" style="zoom:50%;" /> | ||
|
||
```shell | ||
PS E:\github\mini_gtest> git pull | ||
remote: Enumerating objects: 4, done. | ||
remote: Counting objects: 100% (4/4), done. | ||
remote: Compressing objects: 100% (2/2), done. | ||
remote: Total 3 (delta 1), reused 0 (delta 0), pack-reused 0 | ||
Unpacking objects: 100% (3/3), done. | ||
From https://github.com/youhuangla/mini_gtest | ||
a8766f4..7ddbcab master -> origin/master | ||
Updating a8766f4..7ddbcab | ||
Fast-forward | ||
README.md | 1 + | ||
1 file changed, 1 insertion(+) | ||
create mode 100644 README.md | ||
``` | ||
|
||
愉快的无脑三件套吧! | ||
|
||
```shell | ||
git add . | ||
git commit -a | ||
git push | ||
``` | ||
|
This file contains 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.