题目链接:7-25 念数字
一. 题目
1. 题目
2. 输入输出格式
3. 输入输出样例
4. 限制
二、代码
1. 代码实现
#include <iostream>
#include <string>
using namespace std;const string pinyin[] = { // 每个数字对应的拼音"ling","yi","er","san","si","wu","liu","qi","ba","jiu"
};int main(void) {int num;string str;cin >> num;str = "";if (num < 0) {cout << "fu ";num = -num;}do {if (!str.empty()) {str = pinyin[num % 10] + " " + str;} else {str = pinyin[num % 10];}num /= 10;} while(num != 0);cout << str << endl;return 0;
}