1060 Are They Equal /* Sologala @github https://github.com/Sologala/PAT_OJ PAT_oj No.1060_Are_They_Equal */ 可以先把小数点移动最左边。 然后按要求 输出几位,不够补上0. 还要注意如果是000001.00001 这种需要把 整数部分前面的0清掉,但整数部分是 0的时候 ,比如
PAT 1060 Are They Equal (25 分) 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.123×1050.123×10^50.123&t...
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*105with simple chopping. Now given the number of significant digits on a machine and two float numbers, you are supposed to tell...
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了~...
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 treated equal in that ...
参考这位大神的代码!@日沉云起【pat甲级1060. Are They Equal (25) 】 代码简洁,清晰易懂,注释详细,妙不可言!膜了! (这一题看上去很简单,实际上繁琐之极。。。抛出几个例子就知道了) //test1 99 0.00 0.000 //result YES 0.0000000000000000000000000000000000000000000000000000000000000000000000000000000...
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...
PAT A1060 Are They Equal 一、题目大意 PAT A1060 给出有效位数 n ,给出两个浮点数,问在(类似)科学计数法的存储情况下,只考虑有效位以内的尾数(其余的直接截去,不四舍五入)和指数,判断两个数是否相等。 二、解题思路 基本思路就是标准化处理。将两个字符串都处理成标准尾数和指数的形式,然后判等。
only 3 significant digits, the float numbers 12300 and 12358.9 are considered equal since they are both saved as 0.123×10^5with simple chopping. Now given the number of significant digits on a machine and two float numbers, you are supposed to tell if they are treated equal in that ...