对我来说,这些代码
static int faktorial (int n) throws ArithmeticException {
if ((n < 0) || (n > 31)) {
throw new ArithmeticException();
}
if (n > 1) {
return n * faktorial(n - 1);
}
else {
return 1;
}
}
Run Code Online (Sandbox Code Playgroud)
没有相同的代码
throws ArithmeticException
Run Code Online (Sandbox Code Playgroud)
当我使用以下代码时,请执行相同的操作:
public static void main(String[] args) {
try {
int n;
Scanner sc = new Scanner(System.in);
System.out.print("Insert integer number: ");
n = sc.nextInt();
System.out.println(n + "! = " + faktorial(n));
}
catch (InputMismatchException e) {
System.out.println("Not an …Run Code Online (Sandbox Code Playgroud) 我想创建这样的东西:
我准备了以下测试页面:
p {
display: inline;
background-color: yellow;
box-shadow: 10px 0px 0px red, -10px 0px 0px red;
}Run Code Online (Sandbox Code Playgroud)
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<p>Here will be a text. Here will be a text. Here will be a text. Here will be a text. Here will be a text. Here will be a text. Here will be a text. Here will be a text. Here will be a text. Here will be a text. Here will be a text. Here …Run Code Online (Sandbox Code Playgroud)