#17579: c++ 10行解法


321qwedsa000@gmail.com (張皓雨)

學校 : 不指定學校
編號 : 70186
來源 : [203.72.100.2]
最後登入時間 :
2017-09-29 15:03:01
a022. 迴文 | From: [203.72.100.2] | 發表日期 : 2019-04-24 10:05

<pre id="code" class="language-cpp hljs"><span class="hljs-meta">#<span class="hljs-meta-keyword">pragma</span> GCC optimize(<span class="hljs-meta-string">"O3"</span>)</span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">include</span> <span class="hljs-meta-string">&lt;iostream&gt;</span></span>
<span class="hljs-meta">#<span class="hljs-meta-keyword">define</span> _ ios::sync_with_stdio(false),cin.tie(nullptr);</span>

<span class="hljs-keyword">using</span> <span class="hljs-keyword">namespace</span> <span class="hljs-built_in">std</span>;
<span class="hljs-keyword">char</span>* s[<span class="hljs-number">2</span>] = {<span class="hljs-string">"no\n"</span>,<span class="hljs-string">"yes\n"</span>};
<span class="hljs-function"><span class="hljs-keyword">int</span> <span class="hljs-title">main</span><span class="hljs-params">()</span> </span>{ _
<span class="hljs-built_in">string</span> str;
<span class="hljs-keyword">while</span>(<span class="hljs-built_in">cin</span> &gt;&gt; str &amp;&amp; !str.empty()) <span class="hljs-built_in">cout</span> &lt;&lt; s[equal(str.begin(),str.begin()+str.length()/<span class="hljs-number">2</span>,str.rbegin())];
}</pre>
 
ZeroJudge Forum