Created
July 14, 2016 15:08
-
-
Save uplus/c0075a23d64dae7598962cb431d02913 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
#include <cstdlib> | |
using namespace std; | |
int main(int argc, const char* argv[]){ | |
int n = argc == 1? 1: atoi(argv[1]); | |
if(n%15 == 0) cout << "FizzBuzz" << endl; | |
else if(n%3 == 0) cout << "Fizz" << endl; | |
else if(n%5 == 0) cout << "Buzz" << endl; | |
else cout << n << endl; | |
string s = (string{ argv[0] } + " " + to_string(n+1)); | |
if(n != 100) system(s.c_str()); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment