Created
May 2, 2020 22:43
-
-
Save donkaban/b5b837a610f58b55e9918e14ecc4fd9b to your computer and use it in GitHub Desktop.
This file contains 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 <iostream> | |
int main() | |
{ | |
for(int i=1, c=1, d=1; i<=100; ++i, ++c, ++d) | |
{ | |
if(3 == c) c = 0; | |
if(5 == d) d = 0; | |
if(c && d ) std::cout << i; | |
if(!c) std::cout << "Fizz"; | |
if(!d) std::cout << "Buzz"; | |
std::cout <<std::endl; | |
} | |
return 0; | |
} |
This file contains 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 <iostream> | |
int main() | |
{ | |
for(int i=1, c=1, d=1; i<=100; ++i, ++c, ++d) | |
{ | |
if(3 == c) c = 0; | |
if(5 == d) d = 0; | |
if(c && d ) std::cout << i; | |
if(!c) std::cout << "Fizz"; | |
if(!d) std::cout << "Buzz"; | |
std::cout <<std::endl; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment