解题思路:
注意事项:
参考代码:
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); while (scanner.hasNext()) { int a = scanner.nextInt(); int []arr=new int[a]; int m=0; for(int i=0;i<a;i++) { arr[i]=scanner.nextInt(); int z=(int) Math.floor(arr[i]/1000); int x=(int) Math.floor((arr[i]-z*1000)/100); int c=(int) Math.floor((arr[i]-z*1000-x*100)/10); int v=(int) Math.floor(arr[i]-z*1000-x*100-c*10); if(v-z-x-c>0) { m++; } } System.out.println(m); } } }
0.0分
2 人评分