Finished
This commit is contained in:
parent
a63fe93d88
commit
d79f0ca19d
1 changed files with 9 additions and 4 deletions
|
@ -7,13 +7,18 @@ public class Main {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
|
||||||
Scanner scan = new Scanner(System.in);
|
Scanner scan = new Scanner(System.in);
|
||||||
|
while (true){
|
||||||
System.out.println("Input an integer to be factored:");
|
System.out.println("Input an positive integer to be factored. Enter \"3.14\" to exit");
|
||||||
System.out.println("Note: Must be positive. If negative, remove negative and make one factor negative");
|
System.out.println("Note: Must be positive. If negative, remove negative and make one factor negative");
|
||||||
double a = scan.nextDouble();
|
double a = scan.nextDouble();
|
||||||
|
if (a == 3.14){
|
||||||
|
break;
|
||||||
|
}
|
||||||
System.out.println(factor(a));
|
System.out.println(factor(a));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
public static String factor(double a){
|
public static String factor(double a){
|
||||||
String thingtoreturn = "";
|
String thingtoreturn = "";
|
||||||
for (int i = 1; i < (.5*a); i++) {
|
for (int i = 1; i < (.5*a); i++) {
|
||||||
|
|
Loading…
Reference in a new issue