1、题目
编写函数
void written_amount(unsigned int amount,char *buffer);
它把amount表示的值转换为单词形式,并储存于buffer中。这个函数可以在一个打印支票的程序中使用。例如,如果amount的值是16312,那么buffer中存储的字符串应该是
SIXTEEN THOUSAND THREE HUNDRED TWELVE
2、代码实现
#include <stdio.h>
#include <string.h>/***它把amount表示的值转换为单词形式,并储存于buffer中。*这个函数可以在一个打印支票的程序中使用。例如,如果amount的值是16312,*那么buffer中存储的字符串应该是*SIXTEEN THOUSAND THREE HUNDRED TWELVE**/
void written_amount(unsigned int amount, char *buffer)
{char value1_9[10][10] = { "ZERO", "ONE", "TWO", "THREE", "FOUR", "FIVE","SIX", "SEVEN", "EIGHT", "NINE" };char value10_19[10][10] = {"TEN", "ELEVEN", "TWELVE", "THIRTEEN", "FOURTEEN