import java.util.*;
public class k37 {
public static void main(String[] args){
Scanner in=new Scanner(System.in);
System.out.println(“/t教师人数统计”);
System.out.println(“——————————“);
int i=1,n,num1=0,num2=0,num3=0;
System.out.println(“请输入教师人数:”);
int m=in.nextInt();
do{
System.out.print(“请输入第”+i+”位教师的年龄:”);
n=in.nextInt();
if(n>=23&&n<=35)
num1++;
else if(n>=36&&n<=45)
num2++;
else if(n>=46&&n<=59)
num3++;
i++;
}
while(i<=m);
System.out.println(“青年教师有”+num1+”人”);
System.out.println(“中青年教师有”+num2+”人”);
System.out.println(“中年教师有”+num3+”人”);
}
}
原创文章,作者:Maggie-Hunter,如若转载,请注明出处:https://blog.ytso.com/244256.html