61 lines
8.1 KiB
HTML
61 lines
8.1 KiB
HTML
|
|
||
|
<html>
|
||
|
<body>
|
||
|
<html><head></head><body><h1 id="go">Go</h1>
|
||
|
<pre><code class="language-go"><pre tabindex="0" style="background-color:#fff;"><code><span style="display:flex;"><span><span style="color:#000;font-weight:bold">func</span> <span style="color:#900;font-weight:bold">fizzbuzz</span>(n <span style="color:#458;font-weight:bold">int</span>) {
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">for</span> i <span style="color:#000;font-weight:bold">:=</span> <span style="color:#099">1</span>; i <span style="color:#000;font-weight:bold"><=</span> n; i<span style="color:#000;font-weight:bold">++</span> {
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">if</span> i<span style="color:#000;font-weight:bold">%</span><span style="color:#099">15</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#099">0</span> {
|
||
|
</span></span><span style="display:flex;"><span> fmt.<span style="color:#900;font-weight:bold">Println</span>(<span style="color:#d14">"fizzbuzz"</span>)
|
||
|
</span></span><span style="display:flex;"><span> } <span style="color:#000;font-weight:bold">else</span> <span style="color:#000;font-weight:bold">if</span> i<span style="color:#000;font-weight:bold">%</span><span style="color:#099">3</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#099">0</span> {
|
||
|
</span></span><span style="display:flex;"><span> fmt.<span style="color:#900;font-weight:bold">Println</span>(<span style="color:#d14">"fizz"</span>)
|
||
|
</span></span><span style="display:flex;"><span> } <span style="color:#000;font-weight:bold">else</span> <span style="color:#000;font-weight:bold">if</span> i<span style="color:#000;font-weight:bold">%</span><span style="color:#099">5</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#099">0</span> {
|
||
|
</span></span><span style="display:flex;"><span> fmt.<span style="color:#900;font-weight:bold">Println</span>(<span style="color:#d14">"buzz"</span>)
|
||
|
</span></span><span style="display:flex;"><span> } <span style="color:#000;font-weight:bold">else</span> {
|
||
|
</span></span><span style="display:flex;"><span> fmt.<span style="color:#900;font-weight:bold">Println</span>(i)
|
||
|
</span></span><span style="display:flex;"><span> }
|
||
|
</span></span><span style="display:flex;"><span> }
|
||
|
</span></span><span style="display:flex;"><span>}
|
||
|
</span></span></code></pre></code></pre>
|
||
|
<h1 id="python">Python</h1>
|
||
|
<pre><code class="language-python"><pre tabindex="0" style="background-color:#fff;"><code><span style="display:flex;"><span><span style="color:#000;font-weight:bold">def</span> <span style="color:#900;font-weight:bold">fizzbuzz</span>(n):
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">for</span> i <span style="color:#000;font-weight:bold">in</span> <span style="color:#0086b3">range</span>(<span style="color:#099">1</span>, n <span style="color:#000;font-weight:bold">+</span> <span style="color:#099">1</span>):
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">if</span> i <span style="color:#000;font-weight:bold">%</span> <span style="color:#099">15</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#099">0</span>:
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#0086b3">print</span>(<span style="color:#d14"></span><span style="color:#d14">'</span><span style="color:#d14">fizzbuzz</span><span style="color:#d14">'</span>)
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">elif</span> i <span style="color:#000;font-weight:bold">%</span> <span style="color:#099">3</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#099">0</span>:
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#0086b3">print</span>(<span style="color:#d14"></span><span style="color:#d14">'</span><span style="color:#d14">fizz</span><span style="color:#d14">'</span>)
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">elif</span> i <span style="color:#000;font-weight:bold">%</span> <span style="color:#099">5</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#099">0</span>:
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#0086b3">print</span>(<span style="color:#d14"></span><span style="color:#d14">'</span><span style="color:#d14">buzz</span><span style="color:#d14">'</span>)
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">else</span>:
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#0086b3">print</span>(i)
|
||
|
</span></span></code></pre></code></pre>
|
||
|
<h1 id="javascript">JavaScript</h1>
|
||
|
<pre><code class="language-javascript"><pre tabindex="0" style="background-color:#fff;"><code><span style="display:flex;"><span><span style="color:#000;font-weight:bold">function</span> fizzbuzz(n) {
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">for</span> (<span style="color:#000;font-weight:bold">var</span> i <span style="color:#000;font-weight:bold">=</span> <span style="color:#099">1</span>; i <span style="color:#000;font-weight:bold"><=</span> n; i<span style="color:#000;font-weight:bold">++</span>) {
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">if</span> (i <span style="color:#000;font-weight:bold">%</span> <span style="color:#099">15</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#099">0</span>) {
|
||
|
</span></span><span style="display:flex;"><span> console.log(<span style="color:#d14">"fizzbuzz"</span>);
|
||
|
</span></span><span style="display:flex;"><span> }
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">else</span> <span style="color:#000;font-weight:bold">if</span> (i <span style="color:#000;font-weight:bold">%</span> <span style="color:#099">3</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#099">0</span>) {
|
||
|
</span></span><span style="display:flex;"><span> console.log(<span style="color:#d14">"fizz"</span>);
|
||
|
</span></span><span style="display:flex;"><span> }
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">else</span> <span style="color:#000;font-weight:bold">if</span> (i <span style="color:#000;font-weight:bold">%</span> <span style="color:#099">5</span> <span style="color:#000;font-weight:bold">==</span> <span style="color:#099">0</span>) {
|
||
|
</span></span><span style="display:flex;"><span> console.log(<span style="color:#d14">"buzz"</span>);
|
||
|
</span></span><span style="display:flex;"><span> }
|
||
|
</span></span><span style="display:flex;"><span> <span style="color:#000;font-weight:bold">else</span> {
|
||
|
</span></span><span style="display:flex;"><span> console.log(i);
|
||
|
</span></span><span style="display:flex;"><span> }
|
||
|
</span></span><span style="display:flex;"><span> }
|
||
|
</span></span><span style="display:flex;"><span>}
|
||
|
</span></span></code></pre></code></pre>
|
||
|
<h1 id="other">Other</h1>
|
||
|
<pre><code>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum accumsan lacus sit amet tortor vehicula, in
|
||
|
fermentum augue rutrum. Donec eu magna posuere, rhoncus lectus ut, lacinia sapien. Nunc maximus risus risus, ac tempus
|
||
|
augue tristique vitae. Vestibulum consequat, tortor eget auctor viverra, ante elit aliquet purus, quis venenatis ex
|
||
|
velit sit amet neque. Praesent in arcu nec eros interdum placerat. Aliquam mi enim, aliquam consectetur feugiat ut,
|
||
|
euismod sed diam. Ut semper venenatis lobortis. Suspendisse suscipit sem vel tellus fringilla fermentum. Nulla eu odio
|
||
|
justo. Sed rutrum massa commodo nisi laoreet, tincidunt posuere velit gravida. Suspendisse potenti. Praesent varius erat
|
||
|
at leo egestas rhoncus.
|
||
|
</code></pre>
|
||
|
</body></html>
|
||
|
</body>
|
||
|
</html>
|