<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<atom:link href="https://www.gentoo-zh.org/extern.php?action=feed&amp;tid=316&amp;type=rss" rel="self" type="application/rss+xml" />
		<title><![CDATA[Gentoo中文社区 / C 练习实例7]]></title>
		<link>https://www.gentoo-zh.org/viewtopic.php?id=316</link>
		<description><![CDATA[C 练习实例7 最近发表的帖子。]]></description>
		<lastBuildDate>Mon, 29 Aug 2022 06:59:02 +0000</lastBuildDate>
		<generator>FluxBB</generator>
		<item>
			<title><![CDATA[C 练习实例7]]></title>
			<link>https://www.gentoo-zh.org/viewtopic.php?pid=322#p322</link>
			<description><![CDATA[<p>题目：输出特殊图案，请在c环境中运行，看一看，Very Beautiful!</p><p>程序分析：字符共有256个。不同字符，图形不一样。</p><p>VC6.0下出现中文乱码(原因+解决方法):</p><p>176的16进制是B0，219的16进制是DB，0xB0DB是&quot;佰&quot;字的内码，所以输出的就是&quot;佰&quot;了。</p><p>主要原因是文件信息的代码页不同，我们所使用的操作系统中文状态下的代码页，要显示扩展的ASCII码需要在437 OEM-美国这个下面显示，这样就可以显示出你所希望的。具体修改控制台的默认代码页步骤如下：</p><p>&#160; &#160; 1.点击运行界面左上角标题栏图标【c:\】，选择默认值一项<br />&#160; &#160; 2.修改默认代码页，936（ANSI/OEM-简体中文GBK）为437 OEM-美国<br />&#160; &#160; 3、关闭后重新运行一下即可</p><p>#include&lt;stdio.h&gt;<br />int main()<br />{<br />&#160; &#160; char a=176,b=219;<br />&#160; &#160; printf(&quot;%c%c%c%c%c\n&quot;,b,a,a,a,b);<br />&#160; &#160; printf(&quot;%c%c%c%c%c\n&quot;,a,b,a,b,a);<br />&#160; &#160; printf(&quot;%c%c%c%c%c\n&quot;,a,a,b,a,a);<br />&#160; &#160; printf(&quot;%c%c%c%c%c\n&quot;,a,b,a,b,a);<br />&#160; &#160; printf(&quot;%c%c%c%c%c\n&quot;,b,a,a,a,b);<br />&#160; &#160; return 0;<br />}</p>]]></description>
			<author><![CDATA[dummy@example.com (batsom)]]></author>
			<pubDate>Mon, 29 Aug 2022 06:59:02 +0000</pubDate>
			<guid>https://www.gentoo-zh.org/viewtopic.php?pid=322#p322</guid>
		</item>
	</channel>
</rss>
