You are viewing a single comment's thread. Return to all comments →
#include <iostream> #include <vector> using namespace std; int main() { vector<string> cool; for (int i = 1; i < 101; i++ ){ if (i % 3 == 0 && i % 5 == 0){ cool.push_back("FizzBuzz"); } else if (i % 3 == 0){ cool.push_back("Fizz"); } else if (i % 5 == 0){ cool.push_back("Buzz"); } else{ cool.push_back(to_string(i)); } } for (int i = 0; i < cool.size(); i++) cout << cool[i] << endl; return 0; }
Seems like cookies are disabled on this browser, please enable them to open this website
FizzBuzz
You are viewing a single comment's thread. Return to all comments →