forked from local-interloper/fizz-buzz
Init commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main() {
|
||||
|
||||
for (int i = 1; i <= 100; i++) {
|
||||
string out = "";
|
||||
|
||||
if (i % 3 == 0) {
|
||||
out += "Fizz";
|
||||
}
|
||||
if (i % 5 == 0) {
|
||||
out += "Buzz";
|
||||
}
|
||||
|
||||
if (out == "") {
|
||||
cout << i << endl;
|
||||
} else {
|
||||
cout << out << endl;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user