2013年4月23日

判断一个数是否为整数(转)

摘要: 思考:判断一个数是否是“整数”,不能用“类型”来判断,因为实型的3.0和4.00也是整数(只不过是多了几个零罢了)。应该用自定义的函数来判断。方法:float型的数都有些偏差,比如4.000,只要存到计算机里面它就不是完完全全的4.000,计算机存储实数的时候,是按照指数格式来存储的,所以会有一定的偏差。但是在一定的精度范围之外,我们可以认为它就是整数了。比如:当我们从键盘输入4.000时,它就等于4,虽然储存成实数时,会有一些偏差,但是当我们判断的时候,它应该就是整数;假如我们写成scanf("%lf",&n),并输入4.000,此时判断的结果应该是YES而不是N 阅读全文

posted @ 2013-04-23 18:16 圣手摘星 阅读(1377) 评论(0) 推荐(0) 编辑

HDOJ分类(转来方便自己)

摘要: 链接:http://acm.hdu.edu.cn/listproblem.php?vol=1分类一:基础题:1000、1001、1004、1005、1008、1012、1013、1014、1017、1019、1021、1028、1029、1032、1037、1040、1048、1056、1058、1061、1070、1076、1089、1090、1091、1092、1093、1094、1095、1096、1097、1098、1106、1108、1157、1163、1164、1170、1194、1196、1197、1201、1202、1205、1219、1234、1235、1236、1248、1 阅读全文

posted @ 2013-04-23 13:35 圣手摘星 阅读(229) 评论(0) 推荐(0) 编辑

POJ 2031 Building a Space Station

摘要: POJ 2031 Building a Space StationD -Building a Space StationTime Limit:1000MSMemory Limit:30000KB64bit IO Format:%I64d & %I64uPOJ 2031DescriptionYou are a member of the space station engineering team, and are assigned a task in the construction process of the station. You are expected to write a 阅读全文

posted @ 2013-04-23 13:08 圣手摘星 阅读(176) 评论(0) 推荐(0) 编辑

导航