{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Check05C - final int P = 607 G = input.nextInt...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import type.lib.ToolBox; import java.io.PrintStream; import java.util.Scanner; i public class Check05C { public static void main(String[] args) { Scanner input = new Scanner(System.in); PrintStream output = System.out; output.println("Enter an integer g [1 < g < 607]");
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: final int P = 607, G = input.nextInt(); ToolBox.crash(!(1 < G && G < P), ". .."); int e = 1, power = G; do { power = (power * G) % P; } while (power != G && (e = e + 1) > 1); output.printf("The smallest e [e > 1 & g^e = g]%n%d", e + 1); } }...
View Full Document

{[ snackBarMessage ]}