Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package javaapplication2;
- import java.util.Scanner;
- public class JavaApplication2 {
- public static void main(String[] args) {
- Scanner Entrada = new Scanner(System.in);
- int a, b, serie, cont, n;
- System.out.print("Cuántos números de la serie quiere calcular");
- n = Entrada.nextInt();
- serie=1;
- cont=0;
- b=1;
- while(cont < n){
- if(n % 2 != 0){
- a = 0;
- while(a < n){
- n = n * (n - 1);
- a++;
- }
- }
- serie = serie * (b + n);
- cont++;
- }
- System.out.print(serie);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement