牛牛正在学习数字转换的算法。给定一个非负整数num,牛牛需要将其转换为对应的英文表示。 请你编写一个函数来解决这个问题,并返回转换后的英文表示。
示例1
输入
1234567
输出
"One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"
备注:
0
加载中...
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型 * @return string字符串 */ public String numberToWords (int num) { // write code here } }
class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型 * @return string字符串 */ string numberToWords(int num) { // write code here } };
#coding:utf-8 # # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param num int整型 # @return string字符串 # class Solution: def numberToWords(self , num ): # write code here
using System; using System.Collections.Generic; class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型 * @return string字符串 */ public string numberToWords (int num) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型 * @return string字符串 */ function numberToWords( num ) { // write code here } module.exports = { numberToWords : numberToWords };
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param num int整型 # @return string字符串 # class Solution: def numberToWords(self , num: int) -> str: # write code here
package main import "fmt" /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型 * @return string字符串 */ func numberToWords( num int ) string { // write code here }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型 * @return string字符串 */ char* numberToWords(int num ) { // write code here }
# # 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 # # # @param num int整型 # @return string字符串 # class Solution def numberToWords(num) # write code here end end
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型 * @return string字符串 */ def numberToWords(num: Int): String = { // write code here } }
object Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型 * @return string字符串 */ fun numberToWords(num: Int): String { // write code here } }
import java.util.*; public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型 * @return string字符串 */ public String numberToWords (int num) { // write code here } }
/** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型 * @return string字符串 */ export function numberToWords(num: number): string { // write code here }
public class Solution { /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型 * @return string字符串 */ func numberToWords ( _ num: Int) -> String { // write code here } }
struct Solution{ } impl Solution { fn new() -> Self { Solution{} } /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param num int整型 * @return string字符串 */ pub fn numberToWords(&self, num: i32) -> String { // write code here } }
1234567
"One Million Two Hundred Thirty Four Thousand Five Hundred Sixty Seven"