franxx112 @ 2023-07-11 18:21:57
import java.util.Scanner;
public class P1046{
public static void main(String[] args){
Scanner reader = new Scanner(System.in);
int[] height = new int[15];
for(int i = 0;i < 10;i++){
height[i]=reader.nextInt();
}
int n = reader.nextInt()+30;
int ans = 0;
for(int i = 0;i < 10;i++){
if(height[i]<=n)ans++;
}
System.out.println(ans);
}
}
可恶居然显示的是 类P1046是公共的, 应在名为 P1046.java 的文件中声明 大佬们看看为啥啊
by TankYu @ 2023-07-11 18:31:55
@franxx112 我不懂Java,但我认为您可以参考P1001中Java标准代码的格式
by TankYu @ 2023-07-11 18:33:40
将类P1046改名叫 Main 可过
by franxx112 @ 2023-07-22 22:38:53
@TankYu 谢谢大佬
by Tx1234567 @ 2023-08-18 09:54:54
kbd!!!!!!!!!!!!!!!!!!