作业帮 > 综合 > 作业

求一个简单的c++程序,将数字转换为英文单词 数字范围为-20亿到20亿

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/16 14:57:31
求一个简单的c++程序,将数字转换为英文单词 数字范围为-20亿到20亿
Integer to English number conversion
Write a program that takes an integer and displays the English name of that value.
You should support both positive and negative numbers,in the range supported by a 32-bit integer (approximately -2 billion to 2 billion).
Examples:
10 -> ten
121 -> one hundred twenty one
1032 -> one thousand thirty two
11043 -> eleven thousand forty three
#include
#include
using namespace std;
void output0to19(int num)
{
switch(num)
{
case 0:break;
case 1:cout