#!/usr/bin/env /friends/bin/cxxscript #include #include #include #include using namespace std; string fizzbuzz(int n){ string f(n % 3 ? "" : "Fizz"); string b(n % 5 ? "" : "Buzz"); auto s = f + b; if (s.empty()) s = to_string(n); return s; } int main (){ list l(30); iota(l.begin(), l.end(), 1); for (auto i:l) { cout << fizzbuzz(i) << endl; } return 0; }