Skip to content

Instantly share code, notes, and snippets.

@kryvoboker
Last active May 11, 2020 16:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kryvoboker/52ede1cfa0dce0c236c9f38f927bd879 to your computer and use it in GitHub Desktop.
Save kryvoboker/52ede1cfa0dce0c236c9f38f927bd879 to your computer and use it in GitHub Desktop.
HomeWork4
import java.util.Scanner;
/**
*
* @author kamaz
*/
public class Main {
public static void main(String [] args) {
Scanner sc = new Scanner(System.in); // Второе задание первого уровня
int n = 1;
System.out.println("Input a");
int a = sc.nextInt();
if (a > 4 && a < 16) {
for (int i = 1; i <= a; i++) {
n *= i;
}
System.out.println(n);
}
else {
System.out.println("Wrong number");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment