Created
October 4, 2017 16:10
-
-
Save mattn/7339de0529a2966bc6c623f18b753187 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| #include <stdio.h> | |
| int main(void) { | |
| int n = 600000 * 3; | |
| int i = 1; | |
| long c; | |
| char buf[BUFSIZ]; | |
| setbuf(stdout, buf); | |
| for (i = 1; i <= n; i++) { | |
| if (i % 3 == 0 && i % 5 == 0) { | |
| c += printf("FizzBuzz\n"); | |
| } | |
| else if (i % 3 == 0) { | |
| c += printf("Fizz\n"); | |
| } | |
| else if (i % 5 == 0) { | |
| c += printf("Buzz\n"); | |
| } | |
| else { | |
| c += printf("\%d\n", i); | |
| } | |
| } | |
| fprintf(stderr, "%d\n", c); | |
| return 0; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment