diff --git a/Prob1.playground/Contents.swift b/Prob1.playground/Contents.swift index ca417e5..8baeff7 100644 --- a/Prob1.playground/Contents.swift +++ b/Prob1.playground/Contents.swift @@ -1,23 +1,23 @@ -//문제1(이 문제 이상하면 풀지 마세요ㅠㅠ) -let numArr1 = [1, 2, 3, 4, 6, 8, 34, 13, 33, 66, 66666, 789] -var retArr1: [Int] = [] -var ret1: Int = 0 - -for i in 0.. Bool in return a % 3 == 0 }.reduce(0) { (k, aa) -> Int in return aa + k } + + +print(ret) + + diff --git a/Prob1.playground/playground.xcworkspace/xcuserdata/cscoi018.xcuserdatad/UserInterfaceState.xcuserstate b/Prob1.playground/playground.xcworkspace/xcuserdata/cscoi018.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..b53adde Binary files /dev/null and b/Prob1.playground/playground.xcworkspace/xcuserdata/cscoi018.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Prob1_answer.playground/Contents.swift b/Prob1_answer.playground/Contents.swift new file mode 100755 index 0000000..ca417e5 --- /dev/null +++ b/Prob1_answer.playground/Contents.swift @@ -0,0 +1,23 @@ +//문제1(이 문제 이상하면 풀지 마세요ㅠㅠ) +let numArr1 = [1, 2, 3, 4, 6, 8, 34, 13, 33, 66, 66666, 789] +var retArr1: [Int] = [] +var ret1: Int = 0 + +for i in 0.. + + + + diff --git a/Prob1_answer.playground/playground.xcworkspace/xcuserdata/cscoi044.xcuserdatad/UserInterfaceState.xcuserstate b/Prob1_answer.playground/playground.xcworkspace/xcuserdata/cscoi044.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100755 index 0000000..37e379c Binary files /dev/null and b/Prob1_answer.playground/playground.xcworkspace/xcuserdata/cscoi044.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Question.playground/Contents.swift b/Question.playground/Contents.swift index c17b3a6..68a0c2e 100644 --- a/Question.playground/Contents.swift +++ b/Question.playground/Contents.swift @@ -4,19 +4,36 @@ import UIKit //입력한 숫자에서 홀수와 짝수로 나눈 후 각 각 새로운 배열로 넣어서 숫자 순으로 배열 + var array: [Int] = [1, 2, 5, 7, 13, 12, 8, 20, 33] var Array1: [Int] = [] var Array2: [Int] = [] for number in array{ + if number%2 == 0 { - Array1.append(number) + + Array1 += [number] + Array1.sort() } + + else { - Array2 += [number] + func check (number1: Int, number2:Int) -> Bool { + return number1 > number2 + } + + Array2 += [number] + } } -let ArrayArray1 = Array1.sorted {$0 < $1} +print(Array1) +print(Array2) + + + +let ArrayArray1 = Array1.filter { (a: Int) -> Bool in return a%2 == 0}.sorted {$0 < $1} print(ArrayArray1) -let ArrayArray2 = Array2.sorted {$0 < $1} +let ArrayArray2 = Array2.filter { (b: Int) -> Bool in return b%2 != 0}.sorted {$0 < $1} print(ArrayArray2) + diff --git a/Question.playground/playground.xcworkspace/contents.xcworkspacedata b/Question.playground/playground.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..919434a --- /dev/null +++ b/Question.playground/playground.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,7 @@ + + + + + diff --git a/Question.playground/playground.xcworkspace/xcuserdata/cscoi018.xcuserdatad/UserInterfaceState.xcuserstate b/Question.playground/playground.xcworkspace/xcuserdata/cscoi018.xcuserdatad/UserInterfaceState.xcuserstate new file mode 100644 index 0000000..0991482 Binary files /dev/null and b/Question.playground/playground.xcworkspace/xcuserdata/cscoi018.xcuserdatad/UserInterfaceState.xcuserstate differ diff --git a/Question_answer.playground/Contents.swift b/Question_answer.playground/Contents.swift new file mode 100755 index 0000000..c17b3a6 --- /dev/null +++ b/Question_answer.playground/Contents.swift @@ -0,0 +1,22 @@ +//: Playground - noun: a place where people can play + +import UIKit + + +//입력한 숫자에서 홀수와 짝수로 나눈 후 각 각 새로운 배열로 넣어서 숫자 순으로 배열 +var array: [Int] = [1, 2, 5, 7, 13, 12, 8, 20, 33] +var Array1: [Int] = [] +var Array2: [Int] = [] +for number in array{ + if number%2 == 0 { + Array1.append(number) + } + else { + Array2 += [number] + } +} +let ArrayArray1 = Array1.sorted {$0 < $1} +print(ArrayArray1) +let ArrayArray2 = Array2.sorted {$0 < $1} +print(ArrayArray2) + diff --git a/Question_answer.playground/contents.xcplayground b/Question_answer.playground/contents.xcplayground new file mode 100755 index 0000000..5da2641 --- /dev/null +++ b/Question_answer.playground/contents.xcplayground @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 433fde7..0000000 --- a/README.md +++ /dev/null @@ -1,24 +0,0 @@ -# 브릿지 - -**강풀** 액션만화 시즌2 - ->한국형 히어로들의 이야기를 그리는 액션 히어로물을 표방하며 무빙의 후속작이자 타이밍 시리즈의 타이머들과 무빙에서 선행등장했던 이능력자들이 한 세계관에서 얽히는 작가 공인의 크로스오버작. - -### 등장인물 -* 김영탁 - 손으로 소리를 내면 시간을 멈출 수 있다. -* 김봉석 - 비행 능력을 지닌 초능력자이며 노란 우비를 입고 다닌다. -* 장희수 - 신체 재생 능력을 지닌 초능력을 가지고 있다. -* 이강훈 - 착하다. - -* 이미현 - 더 착하다. - -* 김두식 - 얘는 나쁘다. - -* 장주원 - 얘는 더 나쁘다. - -* 최일환 - -* 강풀 - 똑똑하다 스마트하다 최고의 웹툰 작가이다. - - - diff --git a/avocado.playground/Contents.swift b/avocado.playground/Contents.swift deleted file mode 100644 index 07ee6d2..0000000 --- a/avocado.playground/Contents.swift +++ /dev/null @@ -1,5 +0,0 @@ -//: Playground - noun: a place where people can play - -import Cocoa - -var str = "Hello, playground"