first commit

This commit is contained in:
Nyagami
2022-12-15 23:51:04 +07:00
commit 87d51fb251
292 changed files with 12623 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
*/
package test;
import java.util.Scanner;
/**
*
* @author hoang
*/
public class Test {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner reader = new Scanner(System.in);
long n = reader.nextLong();
long ans = 0;
long[] f = new long[22];
f[0]=1;
for(int i=1; i<=n ; i++){
f[i]=f[i-1]*i;
ans+=f[i];
}
System.out.print(ans);
reader.close();
}
}