A small program that verifies the Song Debach guess

xiaoxiao2021-03-06  63

/ / Try two people to write a program, deepen the understanding of the interface and implementation of the method, one of them is responsible for writing method isprime (), // is used to determine if a given positive integer is a prime number, and another person is responsible for writing the main method main method (), Using isprime () test // certificate s song Debach guess: Any number of even numbers can be expressed as two probes only and ./**auther starshus ** Date 04/11/20 * / import java.io. BufferedReader; import java.io.inputstreamReader;

//4.9.1public class gedebahe {public static void main (string [] args) {for (;;) {Int a = -1, b, c; // b, c is a decomposition of two numbers .print ( "Please input a oushu:"); // enter an even try {BufferedReader in = new BufferedReader (new InputStreamReader (System.in)); String inputLine = in.readLine (); a = Integer.valueOf (inputLine ) .intValue (); Catch (Exception Exc) {system.out.println ("sorry, please input a number."); return;} if (a% 2! = 0) {System.out.Println (" Sorry, please input a.com; return;} for (b = 1; b

转载请注明原文地址:https://www.9cbs.com/read-89337.html

New Post(0)