it just works, idc anymore
This commit is contained in:
parent
9edefd8877
commit
2532434e58
|
@ -44,25 +44,19 @@
|
|||
.end method
|
||||
|
||||
.method public static main([Ljava/lang/String;)V
|
||||
.limit locals 3
|
||||
.limit locals 2
|
||||
.limit stack 4
|
||||
; parse cli args to int
|
||||
aload 0
|
||||
aaload 0
|
||||
bipush 0
|
||||
aaload
|
||||
invokestatic java/lang/Integer/parseInt(Ljava/lang/String;)I
|
||||
istore 1
|
||||
|
||||
; format
|
||||
iload 1
|
||||
ldc "! = "
|
||||
iload 1
|
||||
invokestatic Factorial/factorial(I)I ; call factorial
|
||||
invokevirtual java/lang/String/format(ILjava/lang/String;I)I
|
||||
astore 2
|
||||
|
||||
; output
|
||||
getstatic java/lang/System/out Ljava/io/PrintStream;
|
||||
aload 2 ; load formatted str
|
||||
invokevirtual java/io/PrintStream/println(Ljava/lang/String;)V
|
||||
iload 1
|
||||
invokestatic Factorial/factorial(I)I ; call factorial
|
||||
invokevirtual java/io/PrintStream/println(I)V
|
||||
return
|
||||
.end method
|
||||
|
|
Loading…
Reference in New Issue