c语言的题,要完整答案
4.Writeaprogram:(1)Requesttheusertoenterapositiveinteger,theintegervalueshouldbelesst...
4. Write a program:
(1) Request the user to enter a positive integer, the integer value
should be less than 1000 and more then 0.
(2) Write a function convertIntToWords(int value), which converts
the passed value to words, and output the words. For example, 13 results in
"one three", and 805 results in "eight nine five".
(3) And then write a new function convertIntToRealWords(int value),
which converts the passed value to words as we really say them. For
example, 13 would be "thirteen" not "one three", 895 is pronounced "eight
hundred ninety five", not "eight nine five" .
(4) Call these two functions in a main() function individually
(5) Test your program with 1, 12, 123, 100, 102, 520 as the entered
positive integers. 展开
(1) Request the user to enter a positive integer, the integer value
should be less than 1000 and more then 0.
(2) Write a function convertIntToWords(int value), which converts
the passed value to words, and output the words. For example, 13 results in
"one three", and 805 results in "eight nine five".
(3) And then write a new function convertIntToRealWords(int value),
which converts the passed value to words as we really say them. For
example, 13 would be "thirteen" not "one three", 895 is pronounced "eight
hundred ninety five", not "eight nine five" .
(4) Call these two functions in a main() function individually
(5) Test your program with 1, 12, 123, 100, 102, 520 as the entered
positive integers. 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询