号(INT)的打印价值阐明 [英] Print value of number (int) spelled out

查看:132
本文介绍了号(INT)的打印价值阐明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有拼写出在C#中一个int一个彻头彻尾的现成办法吗?例如,如果我有:

  int类型的= 53; 



我要打印:

 五十三

不是

 53

如果不,没有任何人对如何既成事实呢?



谢谢!


解决方案

您必须自己编写代码。如果猜的话,我会说这是不是在框架,因为它会是几乎不可能本地化(还有比数字只是名字更到这一点:语序,连字符规则等)。



这唤起了许多回忆,因为它是从我的第一个编程课程的转让早在大学,所以应该不会太难为你写一个刚刚在英语


is there an out-of-box way to spell out an int in C#? For example if I have:

int a = 53;

I want to print:

"fifty three"

not

"53"

If not, does anybody have any examples on how to accomplis this?

Thanks!

解决方案

You have to write that code yourself. If had to guess, I'd say it's not in the framework because it'd be near impossible to localize (there's much more to this than just the names of digits: word order, hyphen rules, etc).

This brings back memories because it was an assignment from my very first programming course back in college, so it shouldn't be too hard for you to write one just in English.

这篇关于号(INT)的打印价值阐明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆