gpt4 book ai didi

java - USACO 计算问题 - 无法找到或加载主要游乐设施

转载 作者:行者123 更新时间:2023-12-02 03:43:27 24 4
gpt4 key购买 nike

我正在 USACO 计算机奥林匹克竞赛中尝试代码,但遇到了第一个问题。如果我提交以下代码,则会收到以下错误:

Run 1: Execution error: Your program exited with exit status `1'.

    ------ Data for Run 1 [length=14 bytes] ------
COMETQ
HVNGAT
----------------------------

Your program printed data to stderr. Here is the data:
-------------------
Error:_Could_not_find_or_load_main_class_ride


-------------------

代码:

import java.io.*;
import java.util.*;
class Ride {
public static BufferedReader bReader;
public static PrintWriter out;
public static StringTokenizer st;

public static void initializeSys(String fileName) throws IOException {
bReader = new BufferedReader(new FileReader(fileName + ".in"));
out = new PrintWriter(new BufferedWriter(new FileWriter(fileName + ".out")));
}
public static long findSumOfLetters(String value) {
long prod = 1;
if (!value.isEmpty()) {
for (int i = 0; i < value.length(); i++) {
prod = prod * (long) (value.charAt(i) - 64);
}
}
return prod;
}
public static void yourRideIsHere() throws IOException {
String x = null;
long[] prods = new long[2];
Arrays.fill(prods, 0);
for (int i = 0; i < 2; i++) {
st = new StringTokenizer(bReader.readLine());
x = (String)st.nextElement();
prods[i] = findSumOfLetters(x.toUpperCase());
}
if (prods[0] % 47 == prods[1] % 47) {
out.print("GO");
} else {
out.print("STAY");
}
}
public static void main(String args[]) throws IOException{
initializeSys("ride");
yourRideIsHere();
out.close();
}
}

请帮我看看我哪里出了问题。

提前致谢!

最佳答案

从评论来看,解决方案是将类名更改为 ride 而不是 Ride

关于java - USACO 计算问题 - 无法找到或加载主要游乐设施,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36581326/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com