Compare commits
2 Commits
b4d8b803af
...
4ceaaf7f37
Author | SHA1 | Date | |
---|---|---|---|
4ceaaf7f37 | |||
66527c007a |
13
c05_expression/golf.c
Normal file
13
c05_expression/golf.c
Normal file
@ -0,0 +1,13 @@
|
||||
/* golf.c - 高尔夫锦标赛记分卡 */
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int jane, tarzan, cheeta;
|
||||
|
||||
cheeta = tarzan = jane = 68;
|
||||
printf("\t\t\tcheeta\t\ttarzan\t\tjane\n");
|
||||
printf("First round score\t%4d\t%8d\t%8d\n", cheeta, tarzan, jane);
|
||||
|
||||
return 0;
|
||||
}
|
15
c05_expression/squares.c
Normal file
15
c05_expression/squares.c
Normal file
@ -0,0 +1,15 @@
|
||||
/* squares.c - 计算1~20的平方 */
|
||||
#include <stdio.h>
|
||||
|
||||
int main(void)
|
||||
{
|
||||
int num = 1;
|
||||
|
||||
while (num < 21)
|
||||
{
|
||||
printf("%4d\t%6d\n", num, num * num);
|
||||
num = num + 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Reference in New Issue
Block a user