ΟΜΑΔΑ STEAM
Kickass Programmers quprogs
ΟΜΑΔΑ STEAM
Kickass Programmers quprogs
0
ΣΕ ΠΑΙΧΝΙΔΙ
10
ΣΥΝΔΕΔΕΜΕΝΟΙ
Ίδρυση
6 Νοεμβρίου 2015
Γλώσσα
Αγγλικά
Όλες οι συζητήσεις > General Discussion > Λεπτομέρειες θέματος
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 σχόλια
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; 25 Μαρ 2016, 21:08
< >
Εμφάνιση 1-1 από 1 σχόλια
Ανά σελίδα: 1530 50

Όλες οι συζητήσεις > General Discussion > Λεπτομέρειες θέματος
Ημ/νία ανάρτησης: 25 Μαρ 2016, 21:07
Αναρτήσεις: 1