Picolo666 / ADO-

scripts dos programas propostos na ADO do prof bruno.
1 stars 0 forks source link

ADO8 - 02 #61

Open Picolo666 opened 1 year ago

Picolo666 commented 1 year ago

import java.util.Scanner; import java.util.Random;

class Main {

public static void main(String[] args) {
Scanner ler = new Scanner(System.in);
  int num = ler.nextInt();
  int x = fatorial(num);
System.out.println(x);
}    
public static int fatorial(int num){
  int f = 1 ;
  for(int i = num; i > 0; i--){
   f *= i;
  }
  return f;
}

}