diff --git a/Average.java b/Average.java deleted file mode 100644 index d1c1539..0000000 --- a/Average.java +++ /dev/null @@ -1,16 +0,0 @@ -import java.util.Scanner; -public class Average { - public static void main(String args[]){ - Scanner scanner = new Scanner(System.in); - System.out.println("Hello"); - double input1; - double input2; - double input3; - double result; - input1 = scanner.nextDouble(); - input2 = scanner.nextDouble(); - input3 = scanner.nextDouble(); - result = (input1+input2+input3)/3; - System.out.println(result); - } -} diff --git a/Change.java b/Change.java deleted file mode 100644 index eed5ccb..0000000 --- a/Change.java +++ /dev/null @@ -1,22 +0,0 @@ -public class Change { - - public static void main(String args[]) { -//1start -/* - String a = "a:b:c:d"; - char changed[] = a.toCharArray(); - - for (int n = 0; n < a.length(); n++) { - if (changed[n] == ':') { - changed[n] = '#'; - } - } -*/ -//1end -// 2start - String a = "a:b:c:d"; - a = a.replace(":", "#");//2end - System.out.println(a);//주석을 지우면 a 대신 changed를 넣어도 됨 - - } -} diff --git a/Entry.java b/Entry.java new file mode 100644 index 0000000..49b68dd --- /dev/null +++ b/Entry.java @@ -0,0 +1,25 @@ +import java.util.Scanner; + +public class Entry { + int speed; + String name = ""; + + public static void main(String args[]) { + int entryNumber; + Scanner scanner = new Scanner(System.in); + System.out.println("참가자 수를 입력하세요."); + entryNumber = scanner.nextInt(); + Entry[] entryArray = new Entry[entryNumber]; + for (int a = 0; a < entryNumber; a++) { + entryArray[a] = new Entry(); + System.out.println(a + 1 + "번째 참가자의 speed를 입력하세요."); + entryArray[a].speed = scanner.nextInt(); + System.out.println(a + 1 + "번째 참가자의 이름를 입력하세요."); + entryArray[a].name = scanner.next(); + } + System.out.println("---------참가자 소개----------"); + for (int a = 0; a < entryNumber; a++) { + System.out.println("speed : " + entryArray[a].speed + " name : " + entryArray[a].name); + } + } +} diff --git a/IDNumber.java b/IDNumber.java deleted file mode 100644 index 9bb72a4..0000000 --- a/IDNumber.java +++ /dev/null @@ -1,12 +0,0 @@ -import java.util.Scanner; - -public class IDNumber { - public static void main(String args[]){ - String iD; - String yearMonthDay;//나중에 따로 저장해서 시도해 볼 것 - Scanner scanner = new Scanner(System.in); - iD = scanner.nextLine(); - System.out.println(iD.substring(0,6)); - System.out.println(iD.substring(7,14)); - } -} diff --git a/ListToArray.java b/ListToArray.java deleted file mode 100644 index 080d1ab..0000000 --- a/ListToArray.java +++ /dev/null @@ -1,15 +0,0 @@ -import java.util.ArrayList; -import java.util.Arrays; - -public class ListToArray { - public static void main(String argc[]){ - - ArrayList myList = new ArrayList<>(Arrays.asList("Life", "is", "too", "short")); - System.out.println(myList); // [Life, is, too, short] 출력 - String string = ""; - for (String item : myList) { - string += item + " "; - } - System.out.println(string); - } -} diff --git a/ToSet.java b/ToSet.java deleted file mode 100644 index 45a529e..0000000 --- a/ToSet.java +++ /dev/null @@ -1,17 +0,0 @@ -import java.util.ArrayList; -import java.util.Arrays; -import java.util.HashSet; -import java.util.Set; - -public class ToSet { - public static void main(String args[]) { - - ArrayList numbers = new ArrayList<>(Arrays.asList(1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5)); - System.out.println(numbers); // [1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 5] 출력 - Set objective = new HashSet<>(numbers); - System.out.println(objective); - - } -} - - diff --git a/test1.txt b/test1.txt deleted file mode 100644 index f13588b..0000000 --- a/test1.txt +++ /dev/null @@ -1 +0,0 @@ -asdfasdf