Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,17 @@
fromRoman(s)={
my(v=Vecsmall(s),key=vector(88),cur,t=0,tmp);
key[73]=1;key[86]=5;key[88]=10;key[76]=50;key[67]=100;key[68]=500;key[77]=1000;
cur=key[v[1]];
for(i=2,#v,
tmp=key[v[i]];
if(!cur, cur=tmp; next);
if(tmp>cur,
t+=tmp-cur;
cur=0
,
t+=cur;
cur=tmp
)
);
t+cur
};