Roman Numeral Converter
来源:互联网 发布:海思监控客户端软件 编辑:程序博客网 时间:2024/05/19 08:43
题目
将给定的数字转换成罗马数字
代码
function convert(num) { var arr= [["","I","II","III","IV","V","VI","VII","VIII","IX"], ["","X","XX","XXX","XL","L","LX","LXX","LXXX","XC"], ["","C","CC","CCC","CD","D","DC","DCC","DCCC","CM"], ["","M","MM","MMM"]]; var a,b; var index = 0; var roman = ""; while(num !== 0) { a = num % 10; num = Math.floor(num / 10); b = arr[index][a]; roman = b + roman; index++; } return roman;}convert(999);
阅读全文
0 0
- Roman Numeral Converter
- Roman Numeral Converter
- Roman Numeral Converter
- Roman Numeral Converter
- Bonfire: Roman Numeral Converter 阿拉伯 转罗马
- FCC--Roman Numeral Converter(罗马数字的转换)
- Roman Numeral Converter--将给定的数字转换为罗马数字
- Convert Number Into Roman Numeral
- Given a roman numeral, convert it to an integer.
- Converter
- Converter
- Converter
- Notes Part II: Numeral Systems
- 丘奇数(Church numeral)
- poj2685——Numeral System新进制系统
- Converter Tutorial
- ASCII Converter
- Android Retrofit 2.0自定义Converter(JSONObject Converter)
- Linux下不带缓存的I/O操作(复习)
- mt2503[AT Command]CPBR 读取电话本少 "+"号
- 动态存储和静态存储区域区别
- python
- No rule to make target `out/target/common/obj/APPS/framework-res_intermediates/src/R.stamp
- Roman Numeral Converter
- 你的人生经历
- 在树莓派上用python实现motion detection的方法汇总
- 【学习C++】C++类中头文件(.h)和源文件(.cpp)都应该写些什么(计算圆形面积)
- Electron创建桌面应用程序Helloword
- Session 其他的范围对象的得到方式
- 函数判断year是不是润年
- Riemanian manifold
- 【入门笔记】一小时学完AJAX(仅供本人笔记,如学习,请移步专门的教程)