題目: MOD3
import java.util.Scanner;
public class Mod3{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
while(sc.hasNext()){
int a = 0,b = 0,c = 0;
for(int i = sc.nextInt(); i-- > 0;){
switch (sc.nextInt() % 3){
case 0:
a++;
break;
case 1:
b++;
break;
case 2:
c++;
break;
}
}
System.out.println(a + " " + b + " " + c);
}
}
}
沒有留言:
張貼留言