Answers for "c++ fizzbuzz"

C++
0

c++ fizzbuzz

// a short fizzbuzz, can make smaller by removing spaces
#include <iostream>

int i;
int main() {
for (auto &o=std::cout; ++i < 101; o<<'\n')
    i%3? o :  o << "Fizz",
    i%5? i%3? o << i :o : o << "Buzz";
}
Posted by: Guest on May-03-2021

Browse Popular Code Answers by Language