This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.math.BigInteger; | |
class DoubleFactorial { | |
public static BigInteger calcDoubleFactorial(int n) { | |
if (n == 0 || n == 1 || n < 0) { | |
return BigInteger.ONE; | |
} | |
BigInteger res = BigInteger.ONE; | |
for (BigInteger i = BigInteger.valueOf(n); !i.equals(BigInteger.ZERO) || | |
!i.equals(BigInteger.ZERO.divide(BigInteger.ONE)); i = i.subtract(BigInteger.TWO)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package machine; | |
import java.util.Scanner; | |
public class Main extends Operation { | |
public static void main(String[] args) { | |
boolean loop = true; | |
Scanner userInput = new Scanner(System.in); | |
while (loop) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package contacts; | |
import java.util.ArrayList; | |
class Contacts { | |
static final String pattern = "^\\+?(\\(\\w+\\)|\\w+[ -]\\(\\w{2,}\\)|\\w+)([ -]\\w{2,})*"; | |
private static final ArrayList<String> firstname = new ArrayList<>(); | |
private static final ArrayList<String> surname = new ArrayList<>(); | |
private static final ArrayList<String> numbers = new ArrayList<>(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package contacts; | |
import java.util.ArrayList; | |
class Contacts { | |
static final String pattern = "^\\+?(\\(\\w+\\)|\\w+[ -]\\(\\w{2,}\\)|\\w+)([ -]\\w{2,})*"; | |
private static final ArrayList<String> firstname = new ArrayList<>(); | |
private static final ArrayList<String> surname = new ArrayList<>(); | |
private static final ArrayList<String> numbers = new ArrayList<>(); |