λ¬Έμ
νμ΄
- μΉ΄μ΄ν
μ λ ¬ μ¬μ©
- 7λͺ
λ§ μΆλ ₯
- BufferedReader μ¬μ©
μ½λ
package algorithm.sort;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class Bj14729_7Moo {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
int n = Integer.parseInt(br.readLine());
int[] answer = new int[100001];
int cnt = 0;
for (int i = 0; i < n; i++) {
answer[(int) (Double.parseDouble(br.readLine()) * 1000)]++;
}
for (int i = 0; i < answer.length; i++) {
while (answer[i] > 0 && cnt < 7) {
System.out.printf("%.3f\n", i / 1000.0);
answer[i]--;
cnt++;
}
}
}
}
μλ νμΈμ μ μλ λ€λ₯΄μ½λλ³΄λ€ κ°κ²°νκ³ λ©μ§μ½λμλ€μ.
λ€λ₯Έ μ½λλ€μ μμ² λ³΅μ‘νκ² νλλ° μλ°μμ²΄λ‘ νλ©΄ λμ΄λκ° μ¬λΌκ°λ€νλλ° μ κΈ°νλ€μ.
μ½λ μ€λͺ μ’ ν΄μ£Όμ€μμμκΉμ
}
νλ¦μμ²΄κ° μ΄ν΄κ°μλ©λλ€ γ γ μλ°μμνμ§μΌλ§μλμμ... μ²μ²ν λ΅μ£Όμ λκ°μ¬νκ² μ΅λλ€