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
# @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 |
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
# @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 |
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
int main(){ | |
if (true || 0/0) { | |
std::cout << "Compile success\n"; | |
} | |
if (true | 0/0) { | |
std::cout << "Compile warning\n"; | |
} |
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> | |
using namespace std; | |
struct Rectangle { | |
int x, y; | |
int width, height; | |
}; | |
int main() { | |
Rectangle rc = {100, 100, 50, 50}; |