• 回答数

    4

  • 浏览数

    232

周某某先生
首页 > 英语培训 > 数字转换英文字母

4个回答 默认排序
  • 默认排序
  • 按时间排序

吃货独依

已采纳

按数字从左到右翻译的话是 one one seven five nine nine (point小数点) one six如果是金额的话 one hundred and seventeen thousand, five hundred and ninty nine point sixteen

数字转换英文字母

185 评论(10)

麻辣土豆56

到百度找到这个工具,然后录入你需要的数字,点击翻译就出来了。

218 评论(11)

小蓉~蓉

很简单的程序,我就不写注释了吧import java.util.Scanner;public class EnglishNumberFormatter { private static final String[] BITS = {"ONE", "TWO", "THREE", "FOUR", "FIVE", "SIX", "SEVEN", "EIGHT,", "NINE", "TEN"}; private static final String[] TEENS = {"ELEVEN", "TWELF", "THIRTEEN", "FOURTEEN", "FIFTEEN", "SIXTEEN", "SEVETEEN", "EIGHTEEN", "NIGHTEEN"}; private static final String[] TIES = {"TWENTY", "THRITY", "FORTY", "FIFTY", "SIXTY", "SEVENTY", "EIGHTY", "NINETY"}; private static Scanner sc; public static void main(String[] args) { sc = new Scanner(***.in); int num = 0; while(num != -1) { System.out.print("Please type a number between 0 and 999: "); num = sc.nextInt(); if(num <0 || num > 999) { continue; } String english = toEnglish(num); System.out.println(english); } System.out.println("Thank you for using this program"); } private static String toEnglish(int num) { if(num == 0) { return "Zero"; } StringBuffer buffer = new StringBuffer(); if(num >= 100) { buffer.append(pickHunder(num)); if(num % 100 != 0) { buffer.append(" AND "); } num -= (num / 100) * 100; } boolean largerThan20 = false; if(num >= 20) { largerThan20 = true; buffer.append(pickTies(num)); num -= (num / 10) * 10; } if(!largerThan20 && num > 10) { buffer.append(pickTeens(num)); num = 0; } if(num > 0) { String bit = pickBits(num); if(largerThan20) { buffer.append(" "); } buffer.append(bit); } return buffer.toString(); } private static String pickHunder(int num) { int hunder = num / 100; return BITS[hunder - 1] + " HUNDER"; } private static String pickTies(int num) { int ties = num / 10; return TIES[ties - 2]; } private static String pickTeens(int num) { return TEENS[num - 11]; } private static String pickBits(int num) { return BITS[num - 1]; }}

100 评论(15)

德润天成

先教你读数字的方法,英文中是三个数字为一组,从后往前算,小树点不计。在529063.84中,我们可以划分为:529,063.84529就是 five hundred and twenty-nine, 因为后面还有三位,即千份位,所以要加上,也就是five hundred twenty and nine thousand, 063很好读,sixty three, 那么小数点怎么读呢,我们按一般的读,eight four, 如果你前面没有 point, 那么后面就加 cent, 即eight four cent, 表货币单位。全部下来就是five hundred and twenty-nine thousand sixty three eight four cent一楼的在千和百分位之间少了 and

265 评论(10)

相关问答