-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
14 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="false" /> | ||
</component> | ||
</module> |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
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 @@ | ||
import java.util.Arrays; | ||
|
||
public class Test { | ||
public static void transform(int[] array1){ | ||
for (int i = 0; i < array1.length; i++) { | ||
array1[i] *= 2; | ||
} | ||
} | ||
public static void main(String[] args) { | ||
int[] array= new int[]{1, 2, 3}; | ||
transform(array); | ||
System.out.println(Arrays.toString(array)); | ||
} | ||
} |
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 @@ | ||
import java.util.Arrays; | ||
|
||
public class Test2 { | ||
public static void initialization(int[] arr){ | ||
for (int i = 0; i < arr.length; i++) { | ||
arr[i] = i + 1; | ||
} | ||
} | ||
public static void main(String[] args) { | ||
int[] array = new int[100]; | ||
initialization(array); | ||
System.out.println(Arrays.toString(array)); | ||
} | ||
} |
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,16 @@ | ||
import java.util.Arrays; | ||
|
||
public class Test3 { | ||
public static void main(String[] args) { | ||
int[] nums = new int[]{1,3,5,7,9,11}; | ||
int target = 20; | ||
for (int i = 0; i < nums.length - 1; i++) { | ||
for (int j = i + 1; j < nums.length; j++) { | ||
if (nums[i] + nums[j] == target){ | ||
int[] array = {i, j}; | ||
System.out.println(Arrays.toString(array)); | ||
} | ||
} | ||
} | ||
} | ||
} |
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,25 @@ | ||
import java.util.Arrays; | ||
|
||
public class Test4 { | ||
public static void Bubble_Sort(int[] nums){ | ||
for (int i = 0; i < nums.length - 1; i++) { | ||
boolean flg = false; | ||
for (int j = 0; j < nums.length - 1 - i; j++) { | ||
if (nums[j] > nums[j+1]){ | ||
int temp = nums[j]; | ||
nums[j] = nums[j+1]; | ||
nums[j+1] = temp; | ||
flg = true; | ||
} | ||
} | ||
if (flg == false){ | ||
return; | ||
} | ||
} | ||
} | ||
public static void main(String[] args) { | ||
int[] array = {7,4,6,2,1,3,5,9,8}; | ||
Bubble_Sort(array); | ||
System.out.println(Arrays.toString(array)); | ||
} | ||
} |
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,6 @@ | ||
public class Test5 { | ||
public static void main(String[] args) { | ||
|
||
System.out.println(); | ||
} | ||
} |