Skip to content

Instantly share code, notes, and snippets.

@pogin503
Created July 22, 2014 16:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pogin503/b946cc910c02a4c6b525 to your computer and use it in GitHub Desktop.
Save pogin503/b946cc910c02a4c6b525 to your computer and use it in GitHub Desktop.
#include <iostream>
#include <vector>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
using namespace std;
int main(){
int n;
cin >> n;
FOR(i, 1, n + 1){
if (i % 15 == 0) cout << "FizzBuzz ";
else if (i % 3 == 0) cout << "Fizz ";
else if (i % 5 == 0) cout << "Buzz ";
else cout << i << " ";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment