fork download
  1. import java.util.*;
  2.  
  3. class A {
  4. public static void main(String[] args) {
  5. System.out.println(new A().x());
  6. }
  7.  
  8. <T>void y(List<T>l,T...a){for(T t:a)l.add(t);}List x(){String b="teen",c="twenty",d="half ",e=" times "+c;String[]a={"zero","one","two","three","four","five","six","seven","eight","nine"},f={c,"thirty","fourty",d+"third"+e,a[3]+e,d+"fourth"+e,a[4]+e,d+"fifth"+e};List<String>g=new ArrayList<>(Arrays.asList(a));y(g,"ten","eleven","twelve","thir"+b,a[4]+b,"fif"+b,a[6]+b,a[7]+b,"eigh"+b,a[9]+b);for(String h:f){y(g,h);for(int i=1;i<=9;i++)y(g,(a[i]+" and "+h));}y(g,"one hundred");return g;}
  9. }
Success #stdin #stdout 0.05s 711168KB
stdin
Standard input is empty
stdout
[zero, one, two, three, four, five, six, seven, eight, nine, ten, eleven, twelve, thirteen, fourteen, fifteen, sixteen, seventeen, eighteen, nineteen, twenty, one and twenty, two and twenty, three and twenty, four and twenty, five and twenty, six and twenty, seven and twenty, eight and twenty, nine and twenty, thirty, one and thirty, two and thirty, three and thirty, four and thirty, five and thirty, six and thirty, seven and thirty, eight and thirty, nine and thirty, fourty, one and fourty, two and fourty, three and fourty, four and fourty, five and fourty, six and fourty, seven and fourty, eight and fourty, nine and fourty, half third times twenty, one and half third times twenty, two and half third times twenty, three and half third times twenty, four and half third times twenty, five and half third times twenty, six and half third times twenty, seven and half third times twenty, eight and half third times twenty, nine and half third times twenty, three times twenty, one and three times twenty, two and three times twenty, three and three times twenty, four and three times twenty, five and three times twenty, six and three times twenty, seven and three times twenty, eight and three times twenty, nine and three times twenty, half fourth times twenty, one and half fourth times twenty, two and half fourth times twenty, three and half fourth times twenty, four and half fourth times twenty, five and half fourth times twenty, six and half fourth times twenty, seven and half fourth times twenty, eight and half fourth times twenty, nine and half fourth times twenty, four times twenty, one and four times twenty, two and four times twenty, three and four times twenty, four and four times twenty, five and four times twenty, six and four times twenty, seven and four times twenty, eight and four times twenty, nine and four times twenty, half fifth times twenty, one and half fifth times twenty, two and half fifth times twenty, three and half fifth times twenty, four and half fifth times twenty, five and half fifth times twenty, six and half fifth times twenty, seven and half fifth times twenty, eight and half fifth times twenty, nine and half fifth times twenty, one hundred]