C++ 将整数转换为相应的英语单词

编程入门 行业动态 更新时间:2024-10-17 18:19:00

C++  将<a href=https://www.elefans.com/category/jswz/34/1771264.html style=整数转换为相应的英语单词"/>

C++ 将整数转换为相应的英语单词

编写一个程序,当输入一个整数以后,可以转换成相应的英文单词输出。如: 123 转换成one hundred twenty three.

#include<iostream>
#include<string.h>
#define N 100
using namespace std;
void hansu1(char x)//1-19的英语单词 
{if(x=='1') cout<<"one";else if(x=='2') cout<<"two";else if(x=='3') cout<<"three"; else if(x=='4') cout<<"four";else if(x=='5') cout<<"five";else if(x=='6') cout<<"six";else if(x=='7') cout<<"seven";else if(x=='8') cout<<"eight";else if(x=='9') cout<<"nine";}
void hansu2(char x)//10、

更多推荐

C++ 将整数转换为相应的英语单词

本文发布于:2024-02-26 06:13:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1701571.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:整数   转换为   英语单词

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!