动态网站设计的目的苏州关键词seo排名
本文章是❤️力扣 (LeetCode)❤️的内容,该专栏还有多篇优质内容在等待你观看,现在点击右上角点击这个————🚀订阅专栏🚀
🔆坚持刷算法
💎每天进步一点点
🚀冲冲冲冲冲冲冲冲冲冲
💯刷力扣 (LeetCode)刷力扣 (LeetCode)
巧解力扣
- 题目💎🍭
- 代码💎🍭
- 反思💎🍭
题目💎🍭
代码💎🍭
class Solution {
public:string num0_19[20] = {"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven","Eight", "Nine", "Ten", "Eleven", "Twelve", "Thirteen","Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen","Nineteen",};string num20_90[8] = {"Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy","Eighty", "Ninety",};string num1000[4] = {"Billion ", "Million ", "Thousand ", "",};string get(int x) { // 返回1 ~ 999的英文表示string res;if (x >= 100) {res += num0_19[x / 100] + " Hundred ";x %= 100;}if (x >= 20) {res += num20_90[x / 10 - 2] + " ";x %= 10;if (x) res += num0_19[x] + ' ';} else if (x) res += num0_19[x] + ' ';return res;}string numberToWords(int num) {if (!num) return "Zero";string res;for (int i = 1e9, j = 0; i >= 1; i /= 1000, j ++ )if (num >= i) {res += get(num / i) + num1000[j];num %= i;}res.pop_back();return res;}
};
反思💎🍭
见代码
看完文章后,估计你全学会了,加油,明天继续!!
给你7个棒棒糖🍭🍭🍭🍭🍭🍭🍭
觉得文章可以,果断❤️点赞❤️收藏❤️关注❤️
粉丝专属福利
🍓学习资料:含C/C++、算法、Mysql、Linux、后端等。
🍓行业资料:关注即可领取PPT模板、简历模板、行业经典书籍PDF。
🍓面试题库:由技术群里的小伙伴们共同投稿,热乎的大厂面试真题,持续更新中。
🍓交流加群:大佬指点迷津,你的问题往往有人遇到过,求资源在群里喊一声。
👇👇👇👇👇👇👇
💌 欢迎大家在评论区提出意见和建议!💌