且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何用文字打印数字?

更新时间:2023-02-11 16:58:57

你好


这个问题很酷。


你可以用这种方式分割数字。(我的意思是首先确定最后一次的数字并继续下去大约一千个)


这里是代码

展开 | 选择 | Wrap | 行号



嗨今天(2006年7月9日)我参加了对向系统的技术访谈。两轮技术面试。我在第一轮就做得很好而在另一轮做得不好。


面试官让我写一个程序打印并用文字给出数字......例如说...如果输入 12345 然后输出应打印为一万二千三百四十五。谁能帮助我如何在c中为此编写程序。等待回复。感谢您。





我认为面试官会要求你为这个问题提供逻辑becoz在面试室内写下程序这是非常困难的,无论如何我给的程序,你只需复制它,粘贴并运行,它就可以工作。

展开 | / span> 选择 | 换行 | 行号


展开 | 选择 | Wrap | 行号

Hi today (9th july 2006) i attended a technical interview in aspire systems. Two rounds of technical interviews. i well in the first round and did bad in the other.

The interviewer asked me to write a program to print and given number in words... say for example... if the input is 12345 then the output should be printed as "twelve thousand three hundred and fourty five" can someone help me how to write a program for this in c. waiting for the reply. thanking you.

hi there

well this problem is quite cool.

Well u can split the number this way.(I mean first determine number at the last at once place and proceed down last thousand or so)

here is the code

Expand|Select|Wrap|Line Numbers


Hi today (9th july 2006) i attended a technical interview in aspire systems. Two rounds of technical interviews. i well in the first round and did bad in the other.

The interviewer asked me to write a program to print and given number in words... say for example... if the input is 12345 then the output should be printed as "twelve thousand three hundred and fourty five" can someone help me how to write a program for this in c. waiting for the reply. thanking you.


Hi,
I think the interviewer would have asked you to give the logic for this question becoz writing the program inside the interview cabin for this is very difficult, anyway I am giving the program, you just copy it and paste and run, it will work.

登录 关闭
扫码关注1秒登录
如何用文字打印数字?
发送“验证码”获取 | 15天全站免登陆