fizzbuzz

warning: Creating default object from empty value in /mnt/web005/a1/00/51694400/htdocs/bwy/public_html/sites/all/modules/i18n/i18ntaxonomy/i18ntaxonomy.pages.inc on line 34.

Most concise C++ FizzBuzz

What is the most concise C++ FizzBuzz?

The following code appears initially to be a pretty good candidate:

#include <iostream>
#include <ostream>

using std::cout;

int main()
{
    for (int i=0;i++<100;)
        (!(i%3)&&cout<<"Fizz")|(!(i%5)&&cout<<"Buzz")||cout<<i,cout<<"\n";
}

Inhalt abgleichen