-
-
Notifications
You must be signed in to change notification settings - Fork 14
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
0bd9ea5
commit 3f63d8c
Showing
5 changed files
with
68 additions
and
7 deletions.
There are no files selected for viewing
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
Binary file not shown.
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 |
---|---|---|
@@ -1,14 +1,13 @@ | ||
/** | ||
* Written byu Kenny Wong | ||
* Copyright 2019 | ||
* | ||
*/ | ||
|
||
#include <stdio.h> | ||
|
||
// 每个程序总是从 main 这个函数开始执行 | ||
int main() | ||
{ | ||
// 这里是单行注释输出日志 | ||
printf("Hello world!"); | ||
return 0; | ||
printf("Hello world!"); // 这里是单行注释输出日志 | ||
return 0; // main 函数 返回了个 0,表示正常终止程序,非 0 表示异常 | ||
} |
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,9 @@ | ||
#include <stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int salary; // 声明一个名为 salary 的变量 | ||
salary = 10000; // 将 10000 存储在 salary 中 | ||
printf("My salary is %d.\n", salary); | ||
return 0; | ||
} |
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,14 @@ | ||
#include <stdio.h> | ||
|
||
int main(void) | ||
{ | ||
int brothers; // 声明一个名为 brothers 的变量 | ||
int brides; // 和一个叫做 brides 的变量 | ||
|
||
brothers = 7; // 将 7 存储在变量 brothers 中 | ||
brides = 7; // 将 7 存储在变量 brides 中 | ||
|
||
// 输出变量内容 | ||
printf("%d brides for %d brothers\n", brides, brothers); | ||
return 0; | ||
} |