Java 代码
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
Scanner cin = new Scanner(System.in);
int n = cin.nextInt();
int ci = 0;
int co = 0;
for (int i = 0; i < n; i ++)
{
int k = cin.nextInt();
if ( k >= 10 && k <= 20)
ci += 1;
else
co += 1;
}
System.out.println (ci + " in");
System.out.println (co + " out");
}
}