我使用了https://www.codingame.com的chrome插件(codin game Sync
),将一个类下载到我的eclipse Version: Luna Service Release 2 (4.4.2)
中。 Windows 8.1 Enteprise
,这是一个非常简单的类:Eclipse不运行静态主类
class Player {
public static void main(String args[]) {
Scanner in = new Scanner(System.in);
int W = in.nextInt(); // width of the building.
int H = in.nextInt(); // height of the building.
int N = in.nextInt(); // maximum number of turns before game over.
int X0 = in.nextInt();
int Y0 = in.nextInt();
System.out.println("0 0");
// game loop
while (true) {
String bombDir = in.next(); // the direction of the bombs from batman's current location (U, UR, R, DR, D, DL, L or UL)
// Write an action using System.out.println()
// To debug: System.err.println("Debug messages...");
// the location of the next window Batman should jump to.
System.out.println("0 0");
}
}
}
但它从来没有任何打印到我的控制台。
点:
我用的类添加到构建路径,但它仍然无法打印任何东西,但它运行的项目。
右键单击项目 - >属性 - > Java构建路径 - >选项卡源 - >选择项目名称/ src目录/ main-> Java的
只有一个,标签上的域开放codin.com
这是用'System.in'扫描你的一些输入。你提供任何?你需要提供5个整数作为输入。 –
尝试Ctrl + F11为您的java程序! – Darshit
它适合我。你在控制台输入什么东西?否则,in.m'nextInt()将永远等待。 – GAlexMES