STEAM 组
Kickass Programmers quprogs
STEAM 组
Kickass Programmers quprogs
0
游戏中
6
在线
成立于
2015 年 11 月 6 日
语言
英语
所有讨论 > General Discussion > 主题详情
makka 2016 年 3 月 25 日 下午 9:07
Code Golf -- Roman Numeral Line Segments
Code Golf Link[codegolf.stackexchange.com]

Write a program or function that accepts an integer in the range 1..3999 as input and returns the number of line segments required to express that integer in standard Roman numerals.

Discuss and leave solutions in the thread.
< >
正在显示第 1 - 1 条,共 1 条留言
makka 2016 年 3 月 25 日 下午 9:08 
C, 129 chars

d,x,n[]={1000,900,500,400,100,90,50,40,10,9,5,4,1,4,5,2,3,1,3,2,4,2,3,2,3,1};f(c){while(d+=(c/n[x])*n[x+13],c%=n[x++]);return d;}

C is clearly the best golfing language
最后由 makka 编辑于; 2016 年 3 月 25 日 下午 9:08
< >
正在显示第 1 - 1 条,共 1 条留言
每页显示数: 1530 50

所有讨论 > General Discussion > 主题详情