// 숫자N을 입력받는다 let endRange = Int(readLine()!)! // 한수의 개수 var count = 0 // 한수의 개수를 센다 for num in 1...endRange { let numbers = Array("\(num)") var commonDifference = 10 var isArithmeticalSequence = true for (index, _) in numbers.enumerated() { // 끝에 도달하면 종료한다 if index == numbers.count - 1 { commonDifference = 10 break } if commonDifference == 10 { commonDifference = getCommonDifference(array: numb..
import Foundation let repeatCount = Int(readLine()!)! for _ in 1...repeatCount { // 값을 받아온다 var scoreArr = readLine()!.split(separator: " ").map{ Double($0)! } let scoreCount = scoreArr[0] scoreArr.remove(at: 0) // 평균을 계산한다 let average = scoreArr.reduce(0, +) / scoreCount let upperAverage = scoreArr.filter { $0 > average } let percentage = Double(upperAverage.count) / Double(scoreArr.count) * 10..