Jessi初学英语,为了快速读出一串数字,编写程序将数字转换成英文:
如22:twenty two,123:one hundred and twenty three。
说明:
数字为正整数,长度不超过十位,不考虑小数,转化结果为英文小写;
输出格式为twenty two;
非法数据请返回“error”;
关键字提示:and,billion,million,thousand,hundred。
知识点: 语言基础,字符串,循环,函数,指针,枚举,位运算,结构体,联合体,文件操作,递归
题目来源: 内部整理
练习阶段: 初级
运行时间限制: 10Sec
内存限制: 128MByte
输入:
输入一个long型整数
输出:
输出相应的英文写法
样例输入:
2356
样例输出:
two thousand three hundred and fifty six
如22:twenty two,123:one hundred and twenty three。
说明:
数字为正整数,长度不超过十位,不考虑小数,转化结果为英文小写;
输出格式为twenty two;
非法数据请返回“error”;
关键字提示:and,billion,million,thousand,hundred。
知识点: 语言基础,字符串,循环,函数,指针,枚举,位运算,结构体,联合体,文件操作,递归
题目来源: 内部整理
练习阶段: 初级
运行时间限制: 10Sec
内存限制: 128MByte
输入:
输入一个long型整数
输出:
输出相应的英文写法
样例输入:
2356
样例输出:
two thousand three hundred and fifty six
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
char *getSubParse(long long num)
{
int i=(int)num;