Compare commits

...

2 Commits

Author SHA1 Message Date
4ceaaf7f37 squares.c 2023-12-08 06:16:32 +08:00
66527c007a golf.c 2023-12-08 06:14:12 +08:00
2 changed files with 28 additions and 0 deletions

13
c05_expression/golf.c Normal file
View 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
View File

@ -0,0 +1,15 @@
/* squares.c - 计算120的平方 */
#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;
}