JavaScript(ES6)87字节
编辑保存的1个字节thx ETHProductions
编辑保存的1个字节以上thx l4me
匿名函数。好久不见,但我没有找到更多打高尔夫球的方法
s=>(l=t=0,s.replace(/[a-z]/ig,c=>l+=++t&&c>'Z'),l/=t,l<.5?1-l+' upp':l+' low')+'ercase'
少打高尔夫球
s=>( // arrow function returning the value of an expression
// here I use comma for clarity,
// in the golfed version it's all merged in a single expression
t = 0, // counter for letters
l = 0, // counter for lowercase letters
s.replace(
/[a-z]/ig, // find all alphabetic chars, upper or lowercase
c => // execute for each found char (in c)
l += ++t && c>'Z', // increment t, increment l if c is lowercase
),
l /= t, // l is the ratio now
( l < .5 // if ratio < 1/2
? (1-l) +' upp' // uppercase count / total (+" upp")
: l +' low' // lowrcase count / total (+" low")
) + 'ercase' // common suffix
)