ホームページ >バックエンド開発 >Python チュートリアル >举例时厌倦了Hello World,42,foobar,还有什么其它选择么?

举例时厌倦了Hello World,42,foobar,还有什么其它选择么?

WBOY
WBOYオリジナル
2016-06-06 16:22:331506ブラウズ

最好充满学院派气质,辞藻华丽而又有典故,即使想装x或恶搞但又要显得不动声色?

回复内容:

烫烫烫 棍斤拷 0xB16B00B C string Console.WriteLine("你好,世界");

/*C#*/

<code class="language-csharp"><span class="k">class</span> <span class="nc">Fuck</span>
<span class="p">{</span>
    <span class="k">public</span> <span class="n">Shit</span> <span class="n">Shit</span><span class="p">{</span><span class="k">get</span><span class="p">;</span><span class="k">protected</span> <span class="k">set</span><span class="p">;}</span> <span class="p">=</span> <span class="k">new</span> <span class="n">Shit</span><span class="p">(</span><span class="n">Bitch</span><span class="p">.</span><span class="n">OriginalBitch</span><span class="p">);</span>
    <span class="k">public</span> <span class="kt">string</span> <span class="n">ShitName</span> <span class="p">=></span> <span class="n">Shit</span><span class="p">.</span><span class="n">Name</span><span class="p">;</span>
    <span class="k">public</span> <span class="kt">bool</span> <span class="nf">IsFuckable</span><span class="p">(</span><span class="n">Bitch</span> <span class="n">bitch</span><span class="p">)</span> <span class="p">=></span> <span class="n">Shit</span><span class="p">.</span><span class="n">Shitter</span><span class="p">.</span><span class="n">Mother</span> <span class="p">==</span> <span class="n">bitch</span><span class="p">.</span><span class="n">Sister</span><span class="p">;</span>
<span class="p">}</span>
</code>
goodbye world! 0xfull int mian() 好久没有看到烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫烫了,敢问42是什么东西? 1. 实现24点游戏
规则大家都知道的,用程序实现

2. 花式Fibonacci数列(in scala):

<code class="language-scala"><span class="k">def</span> <span class="n">fib1</span><span class="o">(</span><span class="n">n</span><span class="k">:</span> <span class="kt">Int</span><span class="o">)</span><span class="k">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="n">n</span> <span class="k">match</span> <span class="o">{</span>
  <span class="k">case</span> <span class="mi">0</span><span class="o">|</span><span class="mi">1</span> <span class="k">=></span> <span class="n">n</span>
  <span class="k">case</span> <span class="k">_</span>   <span class="k">=></span> <span class="n">fib1</span><span class="o">(</span><span class="n">n</span><span class="o">-</span><span class="mi">1</span><span class="o">)</span> <span class="o">+</span> <span class="n">fib1</span><span class="o">(</span><span class="n">n</span><span class="o">-</span><span class="mi">2</span><span class="o">)</span> 
<span class="o">}</span>


<span class="k">def</span> <span class="n">fib2</span><span class="o">(</span><span class="n">n</span><span class="k">:</span> <span class="kt">Int</span><span class="o">)</span><span class="k">:</span> <span class="kt">Int</span> <span class="o">=</span> <span class="o">{</span>
  <span class="k">def</span> <span class="n">itr</span><span class="o">(</span><span class="n">k</span><span class="k">:</span> <span class="kt">Int</span><span class="o">,</span> <span class="n">f0</span><span class="k">:</span> <span class="kt">Int</span><span class="o">,</span> <span class="n">f1</span><span class="k">:</span> <span class="kt">Int</span><span class="o">)</span><span class="k">:</span> <span class="kt">Int</span> <span class="o">=</span>
    <span class="k">if</span><span class="o">(</span><span class="n">k</span> <span class="o">==</span> <span class="n">n</span><span class="o">)</span> <span class="n">f0</span> <span class="k">else</span> <span class="n">itr</span><span class="o">(</span><span class="n">k</span><span class="o">+</span><span class="mi">1</span><span class="o">,</span> <span class="n">f1</span><span class="o">,</span> <span class="n">f0</span><span class="o">+</span><span class="n">f1</span><span class="o">)</span>
  <span class="n">itr</span><span class="o">(</span><span class="mi">0</span><span class="o">,</span> <span class="mi">0</span><span class="o">,</span> <span class="mi">1</span><span class="o">)</span>
<span class="o">}</span>

<span class="k">val</span> <span class="n">fib3</span><span class="k">:</span> <span class="kt">Stream</span><span class="o">[</span><span class="kt">Int</span><span class="o">]</span> <span class="k">=</span> <span class="mi">0</span> <span class="o">#::</span> <span class="n">fib3</span><span class="o">.</span><span class="n">scanLeft</span><span class="o">(</span><span class="mi">1</span><span class="o">){</span> <span class="k">_</span><span class="o">+</span><span class="k">_</span> <span class="o">}</span>
</code>
声明:
この記事の内容はネチズンが自主的に寄稿したものであり、著作権は原著者に帰属します。このサイトは、それに相当する法的責任を負いません。盗作または侵害の疑いのあるコンテンツを見つけた場合は、admin@php.cn までご連絡ください。