diff options
| author | nsfisis <nsfisis@gmail.com> | 2025-08-13 02:06:59 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2025-08-15 10:06:21 +0900 |
| commit | 8e9dfdbabe0f721e64fd39baa3a0f388c81b65ad (patch) | |
| tree | 6c724cfbeaea94478b542560fa3b40e9f7467330 /examples/fizzbuzz.c | |
| parent | 80e1d0fc957a2f254ca94232cca0269567888ddb (diff) | |
| download | ducc-8e9dfdbabe0f721e64fd39baa3a0f388c81b65ad.tar.gz ducc-8e9dfdbabe0f721e64fd39baa3a0f388c81b65ad.tar.zst ducc-8e9dfdbabe0f721e64fd39baa3a0f388c81b65ad.zip | |
feat: add 2 example files
Diffstat (limited to 'examples/fizzbuzz.c')
| -rw-r--r-- | examples/fizzbuzz.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/examples/fizzbuzz.c b/examples/fizzbuzz.c new file mode 100644 index 0000000..c24ce89 --- /dev/null +++ b/examples/fizzbuzz.c @@ -0,0 +1,14 @@ +int printf(const char*, ...); + +int main() { + for (int i = 1; i <= 100; i++) { + if (i % 15 == 0) + printf("FizzBuzz\n"); + else if (i % 3 == 0) + printf("Fizz\n"); + else if (i % 5 == 0) + printf("Buzz\n"); + else + printf("%d\n", i); + } +} |
