Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试编写一个简单的方法(任何语言),它给出 6 个最低有效数字。
method giveSD(n) { return 6 least significant number; }
例如,如果 n 是 1963222,则该方法应返回 963222。
使用数学!一样简单return n % 1000000;。
return n % 1000000;
希望会有用。
int giveSD(int i) { 字符串 sValue=String.valueOf(i); return Integer.parseInt(sValue.substring(sValue.length()-8, sValue.length())); }