这是我的代码:
int m[][3] = {
{ 0 , 1 , 2 },
{ 10, 11, 12 },
{ 20, 21, 22 }
};
printf("%d %d\n", m[1] - m[0], m[1][0] - m[0][0]);
Run Code Online (Sandbox Code Playgroud)
为什么呢
m[1] - m[0]
Run Code Online (Sandbox Code Playgroud)
回来3?我知道为什么第二个表达式会返回,10但第一个表达式对我来说似乎不合逻辑.
当我启动打包的jar时出现此错误.当我从IDE运行它时,它不会给出错误并运行.
java.io.FileNotFoundException: file:\C:\Development\Kotlin\AccountTool\target\AccountTool-1.0-SNAPSHOT-jar-with-dependencies.jar!\accounts.json (The filename, directory name or volume label syntax is incorrect)
at java.io.FileInputStream.open0(Native Method)
at java.io.FileInputStream.open(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileInputStream.<init>(Unknown Source)
at java.io.FileReader.<init>(Unknown Source)
at com.martacus.accounttool.ToolView$handler.readData(Tool.kt:41)
at com.martacus.accounttool.ToolView.<init>(Tool.kt:56)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at java.lang.Class.newInstance(Unknown Source)
at tornadofx.FXKt.find(FX.kt:238)
at tornadofx.App.start(App.kt:27)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(Unknown Source)
at com.sun.javafx.application.LauncherImpl$$Lambda$52/31866147.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$45/2900468.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$48/4210449.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$47/24077489.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown …Run Code Online (Sandbox Code Playgroud) 我想在彼此之后运行2个循环,但是它没有给我第二个日志消息,p.sendMessage()因为它在第一个循环中停止.我已经尝试了一些不同的方法,但我需要列表.任何人都可以帮我吗?
if(args[0].equalsIgnoreCase("start")){
if(game.players.containsKey(p.getUniqueId())){
String arenaname = game.players.get(p.getUniqueId());
ArrayList<UUID> listofplayer = new ArrayList<UUID>();
for (Entry<UUID, String> entry : game.players.entrySet()) {
if(entry.getValue().equalsIgnoreCase(arenaname)){
listofplayer.add(entry.getKey());
p.sendMessage("added");
}
}
for(int i=0; i==listofplayer.size()+1; i++){
UUID uuid = listofplayer.get(i);
p.sendMessage("added2");
for(Player player : Bukkit.getServer().getOnlinePlayers()){
if(player.getUniqueId().equals(uuid)){
p.sendMessage("added3");
World world = Bukkit.getWorld(main.arenas.getString("arenas." + arenaname + "." + i+1 + ".world"));
Location loc = new Location(world, main.arenas.getDouble("arenas." + arenaname + "." + i+1 + ".X")
, main.arenas.getDouble("arenas." + arenaname + "." + i+1 + ".Y")
, main.arenas.getDouble("arenas." + …Run Code Online (Sandbox Code Playgroud)