-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e5e65e
commit 005261d
Showing
3 changed files
with
46 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
/* | ||
* Author: fasion | ||
* Created time: 2019-07-20 12:20:13 | ||
* Last Modified by: fasion | ||
* Last Modified time: 2019-07-20 12:22:58 | ||
*/ | ||
|
||
public class CommandLineArgs { | ||
public static void main(String args[]) { | ||
for (int i=0; i<args.length; i++) { | ||
System.out.printf("Args %d: `%s`\n", i, args[i]); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Author: fasion | ||
* Created time: 2019-07-20 12:18:01 | ||
* Last Modified by: fasion | ||
* Last Modified time: 2019-07-20 12:18:40 | ||
*/ | ||
|
||
public class HelloWorld { | ||
public static void main(String args[]) { | ||
System.out.println("Hello, world!"); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/* | ||
* Author: fasion | ||
* Created time: 2019-07-20 12:02:52 | ||
* Last Modified by: fasion | ||
* Last Modified time: 2019-07-20 12:16:29 | ||
*/ | ||
|
||
public class Fibonacci { | ||
public static int fibonacci(int n) { | ||
if (n==1 || n==2) { | ||
return 1; | ||
} | ||
return Fibonacci.fibonacci(n-1) + Fibonacci.fibonacci(n-2); | ||
} | ||
|
||
public static void main(String[] args) { | ||
int n = Integer.parseInt(args[0]); | ||
System.out.println(Fibonacci.fibonacci(n)); | ||
} | ||
} |