We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 641df67 commit 06c5e64Copy full SHA for 06c5e64
recursiveFunction/PowerOf.java
@@ -18,18 +18,18 @@ public static void main(String[] args) {
18
String c = s.nextLine();
19
20
int a;
21
-
22
- // if negative exponent
+
23
if (c.contains("-")) {
24
c = c.substring(1);
25
a = Integer.valueOf(c);
26
System.out.println(b + " to the power of " + "-" + a + " is " + "1/" + powerOf(b, a));
+ System.out.println("1/(" + b + superscript(a) + ")");
27
}
28
29
- // if positive exponent or zero
30
else {
31
32
System.out.println(b + " to the power of " + a + " is " + powerOf(b, a));
+ System.out.println(b + superscript(a));
33
34
35
0 commit comments