Files

84 lines
5.6 KiB
XML
Raw Permalink Normal View History

2025-07-25 02:15:37 +08:00
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Cheat Sheets on SWangNice</title>
<link>http://localhost:1313/notes/coding/cheat_sheet/</link>
<description>Recent content in Cheat Sheets on SWangNice</description>
<generator>Hugo -- gohugo.io</generator>
<language>en</language>
<copyright>© 2025 SWang</copyright>
<lastBuildDate>Fri, 20 Sep 2024 04:17:50 +0000</lastBuildDate><atom:link href="http://localhost:1313/notes/coding/cheat_sheet/index.xml" rel="self" type="application/rss+xml" />
<item>
<title>C</title>
<link>http://localhost:1313/notes/coding/cheat_sheet/c/</link>
<pubDate>Fri, 20 Sep 2024 04:17:50 +0000</pubDate>
<guid>http://localhost:1313/notes/coding/cheat_sheet/c/</guid>
2025-08-18 20:01:21 +08:00
<description>&lt;!-- 笔试题有的时候不给正常输入只给plain text --&gt;
&lt;h2 class=&#34;relative group&#34;&gt;Format Specifier
&lt;div id=&#34;format-specifier&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
&lt;span
class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
&lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
style=&#34;text-decoration-line: none !important;&#34; href=&#34;#format-specifier&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Common specifiers:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;%d int
%u unsigned int
%c char
%s string (char s[])
%p void*
%ld long
%lld long long (64bits)
%f float/double
%lf float/double(usually used in scanf)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;We can extend the format specifiers:&lt;/p&gt;
&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; class=&#34;chroma&#34;&gt;&lt;code class=&#34;language-C&#34; data-lang=&#34;C&#34;&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;nf&#34;&gt;printf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;%5d&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// width &amp;#34; 33&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;printf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;%.2f&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;3.14159&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;// precision &amp;#34;3.14&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;printf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;%8.2f&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mf&#34;&gt;3.14159&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt;&lt;span class=&#34;c1&#34;&gt;// &amp;#34; 3.14&amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class=&#34;line&#34;&gt;&lt;span class=&#34;cl&#34;&gt;&lt;span class=&#34;c1&#34;&gt;&lt;/span&gt;&lt;span class=&#34;nf&#34;&gt;printf&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;(&lt;/span&gt;&lt;span class=&#34;s&#34;&gt;&amp;#34;%-5d&amp;#34;&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;,&lt;/span&gt; &lt;span class=&#34;mi&#34;&gt;33&lt;/span&gt;&lt;span class=&#34;p&#34;&gt;);&lt;/span&gt; &lt;span class=&#34;c1&#34;&gt;//Alignment &amp;#34;33 &amp;#34;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;
&lt;h2 class=&#34;relative group&#34;&gt;IO
&lt;div id=&#34;io&#34; class=&#34;anchor&#34;&gt;&lt;/div&gt;
&lt;span
class=&#34;absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100&#34;&gt;
&lt;a class=&#34;group-hover:text-primary-300 dark:group-hover:text-neutral-700&#34;
style=&#34;text-decoration-line: none !important;&#34; href=&#34;#io&#34; aria-label=&#34;Anchor&#34;&gt;#&lt;/a&gt;
&lt;/span&gt;
&lt;/h2&gt;
&lt;p&gt;Read or print via terminal:&lt;/p&gt;</description>
2025-07-25 02:15:37 +08:00
<media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://localhost:1313/notes/coding/cheat_sheet/c/feature.png" />
</item>
<item>
<title>C&#43;&#43;</title>
<link>http://localhost:1313/notes/coding/cheat_sheet/cpp/</link>
<pubDate>Fri, 20 Sep 2024 04:17:50 +0000</pubDate>
<guid>http://localhost:1313/notes/coding/cheat_sheet/cpp/</guid>
<description></description>
<media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://localhost:1313/notes/coding/cheat_sheet/cpp/feature.png" />
</item>
<item>
<title>Python</title>
<link>http://localhost:1313/notes/coding/cheat_sheet/python/</link>
<pubDate>Fri, 20 Sep 2024 04:17:50 +0000</pubDate>
<guid>http://localhost:1313/notes/coding/cheat_sheet/python/</guid>
<description></description>
<media:content xmlns:media="http://search.yahoo.com/mrss/" url="http://localhost:1313/notes/coding/cheat_sheet/python/feature.png" />
</item>
</channel>
</rss>