function checkRates(str){ var re = /^(([1-9][0-9]*\.[0-9][0-9]*)|([0]\.[0-9][0-9]*)|([1-9][0-9]*)|([0]{1}))$; //判断字符串如果是整数不能以0开头后面加正整数,如果是浮点数整数部分不能为两个0:如00.00,如果是整数, var Sure; if (!re.test(str)){ Sure =0; }else{ Sure…
问题描述: We are asking for a function to take a positive integer value, and return a list of all positive integer pairs whose values - when squared- sum to the given integer. For example, given the parameter 25, the function could return two pairs of 5,…