如何在C中将int转换为字符串中的负数和正数? [英] How can I convert int to string both negative and positive numbers in C?

查看:544
本文介绍了如何在C中将int转换为字符串中的负数和正数?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法将负数转换为c中的单词。

喜欢

输入= -123046

输出=减去一个二十三万四千六十五。



我尝试过:



i尝试了数组字符串和函数。

i can't convert the negative numbers to word in c.
like
input= -123046
output = minus one lac twenty three thousand forty six.

What I have tried:

i tried Array string and function.

推荐答案

请摘一个参考来自



将给定数字转换为单词的程序 - GeeksforGeeks [ ^ ]
Please take a ref from

Program to convert a given number to words - GeeksforGeeks[^]


这是一个常见的作业问题,几年前我写了一个提示:将数字转换为等效的单词。 [ ^ ] - 它在C#中,但C代码将使用相同的原理,语法大致相同。
This is such a common homework problem that I wrote a tip on it some years ago: Converting numbers to the word equivalent. [^] - it's in C#, but the C code would use the same principles, and much the same syntax.


这篇关于如何在C中将int转换为字符串中的负数和正数?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆