File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ .idea
2+ target /
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <module org.jetbrains.idea.maven.project.MavenProjectsManager.isMavenModule=" true" type =" JAVA_MODULE" version =" 4" >
3+ <component name =" NewModuleRootManager" LANGUAGE_LEVEL =" JDK_1_8" >
4+ <output url =" file://$MODULE_DIR$/target/classes" />
5+ <output-test url =" file://$MODULE_DIR$/target/test-classes" />
6+ <content url =" file://$MODULE_DIR$" >
7+ <sourceFolder url =" file://$MODULE_DIR$/src/main/java" isTestSource =" false" />
8+ <sourceFolder url =" file://$MODULE_DIR$/src/main/resources" type =" java-resource" />
9+ <sourceFolder url =" file://$MODULE_DIR$/src/test/java" isTestSource =" true" />
10+ <excludeFolder url =" file://$MODULE_DIR$/target" />
11+ </content >
12+ <orderEntry type =" inheritedJdk" />
13+ <orderEntry type =" sourceFolder" forTests =" false" />
14+ </component >
15+ </module >
Original file line number Diff line number Diff line change 1+ <?xml version =" 1.0" encoding =" UTF-8" ?>
2+ <project xmlns =" http://maven.apache.org/POM/4.0.0"
3+ xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
4+ xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
5+ <modelVersion >4.0.0</modelVersion >
6+
7+ <groupId >cn.synway</groupId >
8+ <artifactId >classicalProgramming</artifactId >
9+ <version >1.0-SNAPSHOT</version >
10+
11+
12+ </project >
Original file line number Diff line number Diff line change 1+ /**
2+ * Author: wenci on 2017/12/17.
3+ * Description: 求阶乘,尾递归
4+ */
5+ public class Factorial {
6+ public static void main (String [] args ) {
7+ System .out .println (getFact (5 ));
8+ }
9+
10+ public static long getFact (long input ) {
11+ long factorial = 1 ;
12+ if (input == 1 ) {
13+ return factorial ;
14+ }
15+ return factorial = input * getFact (input - 1 );
16+ }
17+ }
You can’t perform that action at this time.
0 commit comments