Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 13f120e

Browse files
add etc
1 parent b533c62 commit 13f120e

File tree

1 file changed

+0
-11
lines changed
  • src/其他/阿拉伯数字转中文

1 file changed

+0
-11
lines changed

‎src/其他/阿拉伯数字转中文/Main.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,6 @@ public class Main {
88
private static final char[] units = {'十', '百', '千', '万', '亿'};
99
private static final StringBuilder ans = new StringBuilder();
1010

11-
/**
12-
* 采用递归的方法将转换的结果存储到 ans 变量中, 注意 `万` 和 `亿` 在 units 数组中不是连续的, 所以
13-
* 当数字达到5位数或9位数时, 我们分开讨论。
14-
*
15-
* @param num
16-
*/
1711
private static void intToChineseNum(int num) {
1812
String s = String.valueOf(num);
1913
char[] chars = s.toCharArray();
@@ -53,9 +47,4 @@ private static void intToChineseNum(int num) {
5347
}
5448
}
5549
}
56-
57-
public static void main(String[] args) {
58-
Main.intToChineseNum(121399013);
59-
System.out.println(ans.toString());
60-
}
6150
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /