ride.java:8: class Ride is public, should be declared in a file named Ride.java
public class Ride {
^
1 error
这是我的代码
import java.util.*;
import java.io.*;
public class Ride {
static Scanner reader;
static PrintWriter outFile;
int num = 0;
int total_c = 0;
int total_g = 0;
char [] comet = new char [6];
char [] group = new char [6];
public static void main (String [] args) throws Exception
{
reader = new Scanner(new File("ride.in"));
outFile = new PrintWriter(new File("ride.out"));
Ride r = new Ride();
r.run();
}
public void run()
{
char in = '\0';
int x = 0;
while(reader.hasNext())
{
in = reader.next().charAt(0);
if(x<6)
{
comet[x] = in;
}
else
{
group[x-6] = in;
}
x++;
}
for(int a = 0; a < 6; a++)
{
total_c *= (int)(comet[a]-64);
total_g *= (int)(group[a]-64);
}
if(total_c%47 == total_g%47)
{
outFile.print("GO");
}
else
outFile.print("STAY");
}
}
我确实有Ride.java下的文件,但USACO无法编译该程序。