Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class kkk {
- public static void main(String[] args) {
- Scanner sc = new Scanner(System.in);
- int soma = 1,n;
- System.out.println("valor:");
- n = sc.nextInt();
- if (n==0 || n == 1){
- soma = 1;
- }
- for (int i = n; i > 1; i--){
- soma *= i;
- }
- System.out.println("valor: "+soma);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement