If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×10⁵ with simple chopping. Now given the number of significant digits on a machine and two float numbers, you are supposed to tell if they are tr...
如:在可容纳5位有效数字的机器上,12358和12358.9按照科学计数法均为0.12358x10^5(截断不进位) 问题分析: 这道题其实按部就班做就好,但坑点确实挖的有些过火了,导致不知道某些特殊测试点的输出格式,一直无法ac 测试点3(指数为负数情况) 输入3 0.0520 0.0521 输出NO 0.520*10^-1 0.521*10^-1 测试点4(输入存...
【PAT A1060】Are They Equal If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×10^5^ with simple chopping. Now given the number of significant digits on a machine and two float numbers, you are ...
1060 Are They Equal (25 分) If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as0 with simple chopping. Now given the number of significant digits on a machine and two float numbers, you are supposed to te...
如果相等,说明他们用科学计数法表示后是相同的,输出YES,否则输出NO,同时输出正确的科学计数法 注意: – 10的0次方和1次方都要写。 – 题目中说,无需四舍五入。 – 数组开大点,虽然只有100位,但是很有可能前面的0很多导致根本不止100位。一开始开的110,几乎没有AC的任何测试点。。后来开了10000就AC了~...
1060 Are They Equal (25 分) If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0 with simple chopping. Now given the number of significant digits on a machine and two float numbers, you are supposed to ...
B1060 Are They Equal (25分) ///坑很多,特别是处理细节上面/(ㄒoㄒ)/~~ 第一次交的19分以为: 小数就是"0.xxx",整数就是"123.123",然后第一步就错了,用s[0]是否是0来判断是整数还是小数。 然鹅,有这些字符串"0000012.12","0000.0000","000012",所以直接去删前导0会变得复杂 ...
YES 0.123*10^5 1. Sample Input 2: 3 120 128 1. Sample Output 2: NO 0.120*10^3 0.128*10^3 1. 题目大意 科学计算。判断精确到位数N后,两数是否相等。 2,思路 参考这位大神的代码!@日沉云起【pat甲级1060. Are They Equal (25) 】 ...
1060.Are They Equal 题目描述 If a machine can save only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×10^5 with simple chopping. Now given the number of significant digits on a machine and two float numbers, ...
锦城acm吧 关注:5贴子:211 看贴 图片 吧主推荐 游戏 3回复贴,共1页 <返回锦城acm吧#2019-1-22#PAT甲级 1060 Are They Equal (25 分)[标准string类] 只看楼主收藏回复 黑乌鸦2631 核心会员 6 送TA礼物 1楼2019-01-22 11:28回复