Skip to content

Instantly share code, notes, and snippets.

View tk0221's full-sized avatar
:octocat:

J Kim tk0221

:octocat:
  • Seattle, WA
View GitHub Profile
# @param {Integer} n
# @return {String[]}
def fizz_buzz(n)
tmp = []
(1..n).each do |i|
if i % 3 == 0
a = "Fizz"
a+= "Buzz" if i % 5 == 0
tmp.push(a)
elsif i % 5 == 0
# @param {Integer} n
# @return {String[]}
def fizz_buzz(n)
tmp = []
(1..n).each do |i|
tmp.push("FizzBuzz") && next if i % 15 == 0
tmp.push("Fizz") && next if i % 3 == 0
tmp.push("Buzz") && next if i % 5 == 0
tmp.push(i.to_s)
end
int main(){
if (true || 0/0) {
std::cout << "Compile success\n";
}
if (true | 0/0) {
std::cout << "Compile warning\n";
}
@tk0221
tk0221 / gist:8569737
Last active January 4, 2016 04:39
cpp example code
#include <iostream>
using namespace std;
struct Rectangle {
int x, y;
int width, height;
};
int main() {
Rectangle rc = {100, 100, 50, 50};