From 399f8d11331b277f4d5d57167aae491523a5d938 Mon Sep 17 00:00:00 2001 From: wandoubaba517 Date: Tue, 19 Dec 2023 20:46:16 +0800 Subject: [PATCH] bottles.c --- c05_expression/bottles.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 c05_expression/bottles.c diff --git a/c05_expression/bottles.c b/c05_expression/bottles.c new file mode 100644 index 0000000..c933375 --- /dev/null +++ b/c05_expression/bottles.c @@ -0,0 +1,17 @@ +#include + +#define MAX 10 + +int main(void) +{ + int count = MAX + 1; + while (--count > 0) + { + printf("%d bottles of spring water on the wall, " + "%d bottles of spring water!\n", count, count); + printf("Take on down and pass it around,\n"); + printf("%d bottles of spring water!\n\n", count - 1); + } + + return 0; +} \ No newline at end of file