Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Rextester.java
import java.util.Scanner; class Rextester { String numDiologueLn; public static void promptEnterKey() { Scanner scanner = new Scanner(System.in); scanner.nextLine(); } public static void main(String[] args) { Scanner input = new Scanner(System.in); System.out.print("Hey... buddy :)))"); promptEnterKey(); System.out.println("How's it hangin', my doood??"); promptEnterKey(); System.out.print("Bet chu I can find the GCF of two integers faster than you!!"); promptEnterKey(); System.out.println("yo"); promptEnterKey(); System.out.println("Please.. Broski, type the first positive integer, then hit enter."); int a = input.nextInt(); if (a<=0) { System.out.println("\nD:"); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.print("Try again, big man, but this time do it like I told you!!"); return; } System.out.println("\nPlease type the second positive integer, then hit enter, my doood."); int b = input.nextInt(); if (b<=0) { System.out.println("\nD:"); try { Thread.sleep(2000); } catch (InterruptedException e) { e.printStackTrace(); } System.out.print("Try again, big man, but this time do it like I told you!!"); return; } System.out.println("\nHOMIE!!!..."); int gcf; if (a==b) { gcf = a; System.out.println("The GCF is " + gcf + "!!!!!!!!"); } while(b!=0){ if (a > b) { int remainder = a % b; a = b; b = remainder; } else { int temp = a; a = b; b = temp; } } if (a != 1) { gcf = a; System.out.println("The GCF is " + gcf + "!!!!!!!!"); } else { System.out.println("The two numbers are relatively prime!"); } } }
run
|
edit
|
history
|
help
0
LunarLanding.java
linear search
classwork
bit right 2
single_digit
Greedy algo Activity program
http://stackoverflow.com/questions/23175927/how-to-clone-object-defined-by-interface
Main.java
Desvio Padrão - LPI
Java messing around