<?xml version="1.0" encoding="utf-8"?><rss version="2.0">
<channel>
<title><![CDATA[我的c语言之路]]></title>
<link>http://blog.pfan.cn/charleyaa</link>
<description>编程爱好者博客</description>
<language>zh-cn</language>
			<item>
		<title><![CDATA[单精度实数的输出问题！]]></title>
		<link>http://blog.pfan.cn/charleyaa/23624.html</link>
		<description><![CDATA[2007-2-15 20:39:00&nbsp;&nbsp;
http://www.programfan.com/club/showbbs.asp?id=218492
#include&nbsp;"stdio.h"int&nbsp;main(){&nbsp;&nbsp;&nbsp;&nbsp;float&nbsp;a,b;&nbsp;&nbsp;&nbsp;&nbsp;char&nbsp;c='a';&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;i=97;&nbsp;&nbsp;&nbsp;&nbsp;a=31.1111;&nbsp;&nbsp;&nbsp;&nbsp;b=28.333;&nbsp;&nbsp;&nbsp;&nbsp;printf("%f,%7.4f\n",a+b,a-b);&nbsp;&nbsp;&nbsp;//a+b输出单精度浮点数不是7位有效数字吗？为什么输出答案是59.444099而不是正确答案59.444100呢？&nbsp;&nbsp;&nbsp;&nbsp;这里似乎如果存在四舍五入的情况，不用double基本输出的小数都有误差的，除非通过%后的参数限制了输出位数有时才可以得出正确的答案
&nbsp;&nbsp;&nbsp; printf("%c,%d\n",c,c);&nbsp;&nbsp;&nbsp;&nbsp;printf("%s,%%\n","china");&nbsp;&nbsp;&nbsp;&nbsp;getchar();}
&nbsp;]]></description>
		<author><![CDATA[charleyaa]]></author>
		<pubDate>2007-03-03 15:50:00</pubDate>
		</item>
				<item>
		<title><![CDATA[scanf的格式别写错了！]]></title>
		<link>http://blog.pfan.cn/charleyaa/23623.html</link>
		<description><![CDATA[2007-2-16 13:12:00&nbsp;&nbsp;&nbsp; 
#include"stdio.h"#include"math.h"int&nbsp;main(){&nbsp;&nbsp;&nbsp;&nbsp;float&nbsp;a,b,c,t,y,x1,x2;&nbsp;&nbsp;&nbsp;&nbsp;printf("输入a，b，c的值：");&nbsp;&nbsp;&nbsp;&nbsp;scanf("%f%f%f\n",&amp;a,&amp;b,&amp;c);&nbsp;&nbsp;&nbsp;&nbsp;y=b*b-4*a*c;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(y&gt;0)&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;t=sqrt(b*b-4*a*c);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x1=(-b+t)/(2*a);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x2=(-b-t)/(2*a);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("x1=%f,x2=%f",x1,x2);&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(y&lt;=0)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf("方程无解");&nbsp;&nbsp;&nbsp;&nbsp;return(0);}
看出什么问题了吗？当时编译后记得是没结果，原来是scanf("%f%f%f\n",&amp;a,&amp;b,&amp;c);里多了个\n，太大意了！有时也会忘记给定义的变量加上地址&amp;,初学者啊，还是要细心！]]></description>
		<author><![CDATA[charleyaa]]></author>
		<pubDate>2007-03-03 15:44:00</pubDate>
		</item>
				<item>
		<title><![CDATA[赋值未定义]]></title>
		<link>http://blog.pfan.cn/charleyaa/23622.html</link>
		<description><![CDATA[2007-2-13 15:56:00
百鸡问题
#include"stdio.h"int&nbsp;main(){&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;x,y,z;&nbsp;&nbsp;&nbsp;&nbsp;x=0;&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(x&lt;=19)&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y=0;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(y&lt;=33)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;z=100-x-y;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(5*x+3*y+z/3=100)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;printf&nbsp;("%d%d%d\n",x,y,z);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y++;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x++;&nbsp;&nbsp;&]]></description>
		<author><![CDATA[charleyaa]]></author>
		<pubDate>2007-03-03 15:31:00</pubDate>
		</item>
				<item>
		<title><![CDATA[记得先定义参数！]]></title>
		<link>http://blog.pfan.cn/charleyaa/23621.html</link>
		<description><![CDATA[2007-2-11 22:14:00
#include&nbsp;"stdio.h"int&nbsp;main(){&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;a,b,c;&nbsp;&nbsp;&nbsp;&nbsp;scanf("%d%d",&amp;a,&amp;b);&nbsp;&nbsp;&nbsp;&nbsp;c=max(a,b);&nbsp;&nbsp;&nbsp;&nbsp;printf("max=%d",c);}int&nbsp;max(int&nbsp;x,int&nbsp;y){&nbsp;&nbsp;&nbsp;&nbsp;int&nbsp;z;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(x&gt;y)&nbsp;z=x;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;z=y;&nbsp;&nbsp;&nbsp;&nbsp;return(z);}这段程序为什么会报错大家看出来了吗？那时的我刚刚开始学习，什么形参实参根本就没一点概念，虽然对要先定义再引用还是知道的，不过当时根本就没这想法，正确的应该在int main()前面加上一行int&nbsp;max(int,int)！]]></description>
		<author><![CDATA[charleyaa]]></author>
		<pubDate>2007-03-03 15:28:00</pubDate>
		</item>
				<item>
		<title><![CDATA[怎么察看程序运行的结果]]></title>
		<link>http://blog.pfan.cn/charleyaa/23620.html</link>
		<description><![CDATA[2007-2-11 16:39:00&nbsp;&nbsp;&nbsp;
刚刚开始学习的我还不知道怎么中断程序看运行结果，就发了个《问个Dev-C++的使用问题》的帖子！从这天起，知道了后面书上才学到的getchar()获取字符来中断程序观看结果了！]]></description>
		<author><![CDATA[charleyaa]]></author>
		<pubDate>2007-03-03 15:25:00</pubDate>
		</item>
				<item>
		<title><![CDATA[新手用的编程工具环境的问题]]></title>
		<link>http://blog.pfan.cn/charleyaa/23619.html</link>
		<description><![CDATA[2007-2-2 22:01:00&nbsp;&nbsp;&nbsp;发了我在promgramfan的第一个问题贴，从这时开始，我在大家的指导下选择了用Dev-Cpp作为我的编译工具，开始了我的c语言学习之路！]]></description>
		<author><![CDATA[charleyaa]]></author>
		<pubDate>2007-03-03 15:23:00</pubDate>
		</item>
		</channel>
</rss>