谁能帮小弟解答一道C语言题目 小弟是菜鸟 Write a program that takes an integer keyed in from the terminal and extracts and displays each digit of the integer in English.So,if the user types in 932,the program should display:nine three
来源:学生作业帮助网 编辑:作业帮 时间:2024/06/27 17:52:17
![谁能帮小弟解答一道C语言题目 小弟是菜鸟 Write a program that takes an integer keyed in from the terminal and extracts and displays each digit of the integer in English.So,if the user types in 932,the program should display:nine three](/uploads/image/z/5467333-13-3.jpg?t=%E8%B0%81%E8%83%BD%E5%B8%AE%E5%B0%8F%E5%BC%9F%E8%A7%A3%E7%AD%94%E4%B8%80%E9%81%93C%E8%AF%AD%E8%A8%80%E9%A2%98%E7%9B%AE+%E5%B0%8F%E5%BC%9F%E6%98%AF%E8%8F%9C%E9%B8%9F+Write+a+program+that+takes+an+integer+keyed+in+from+the+terminal+and+extracts+and+displays+each+digit+of+the+integer+in+English.So%2Cif+the+user+types+in+932%2Cthe+program+should+display%3Anine+three)
谁能帮小弟解答一道C语言题目 小弟是菜鸟 Write a program that takes an integer keyed in from the terminal and extracts and displays each digit of the integer in English.So,if the user types in 932,the program should display:nine three
谁能帮小弟解答一道C语言题目 小弟是菜鸟
Write a program that takes an integer keyed in from the terminal and extracts and displays each digit of the integer in English.So,if the user types in 932,the program should display:
nine three two
Remember to display "zero" if the user types in just a 0.
This exercise is non simple,so make sure that you have worked out your algorithm in advance.
谁能帮小弟解答一道C语言题目 小弟是菜鸟 Write a program that takes an integer keyed in from the terminal and extracts and displays each digit of the integer in English.So,if the user types in 932,the program should display:nine three
首先要建立数字0-9和英文”zero“-”nine“的对应关系
然后,一个int数组,存放输入的int的各个数字
然后用输入的那个int不停的除以10,取余,结果放进数组里,再除以10……
直到输入的int为0.另外输入为0的单独处理
依次从数组末尾取出数字转换成鸟文输出到屏幕上
偷懒的方法就是输入的时候你不存成一个int,而直接存在数组里……