2022-11-17 16:20:15 +01:00
|
|
|
|
|
|
|
|
|
|
|
import java.util.Map;
|
|
|
|
import java.io.BufferedReader;
|
|
|
|
import java.io.InputStreamReader;
|
|
|
|
import java.util.HashMap;
|
|
|
|
|
|
|
|
public class Compteur {
|
|
|
|
public static void main(String[] args) {
|
|
|
|
Map<String, Integer> list = new HashMap<>();
|
|
|
|
|
|
|
|
while (true) {
|
|
|
|
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
|
|
|
|
try {
|
|
|
|
String saisie = br.readLine();
|
2022-11-24 15:17:33 +01:00
|
|
|
if (saisie.compareTo("") == 0) {
|
2022-11-17 16:20:15 +01:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (list.containsKey(saisie)) {
|
|
|
|
list.put(saisie, list.get(saisie) + 1);
|
|
|
|
} else {
|
|
|
|
list.put(saisie, 1);
|
|
|
|
}
|
|
|
|
|
|
|
|
System.out.println(list.get(saisie));
|
|
|
|
} catch (Exception ioe) {
|
|
|
|
System.out.println(ioe);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|