Revision ca7c2317-2ea2-411b-82ae-c7b615ad55bc - Stack Overflow

##Java, <strike>200</strike> <strike>192</strike> 180 characters

 class F{public static void main(String[]s){long n=new Long(s[0]);for(int i=1;i<s.length;){long m=n*new Long(s[i++]),d=new Long(s[i++]);if(m%d==0){n=m/d;i=1;}}System.out.print(n);}}

java -cp . F 108 455 33 11 13 1 11 3 7 11 2 1 3

 15625

java -cp . F 1296 3 2

 6561

I think everyone knows that Java would not have the shortest implementation, but I wanted to see how it would compare.

AltStyle によって変換されたページ (->オリジナル) /