小编Mar*_*cus的帖子

为什么m [1] - m [0]返回3,其中m是3x3矩阵?

这是我的代码:

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一个表达式对我来说似乎不合逻辑.

c arrays matrix

36
推荐指数
2
解决办法
1899
查看次数

文件名,目录名或卷标语法不正确 - Kotlin - Maven

当我启动打包的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)

java embedded-resource kotlin

4
推荐指数
1
解决办法
2483
查看次数

彼此运行2个for循环

我想在彼此之后运行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)

java loops for-loop minecraft

-1
推荐指数
1
解决办法
171
查看次数

标签 统计

java ×2

arrays ×1

c ×1

embedded-resource ×1

for-loop ×1

kotlin ×1

loops ×1

matrix ×1

minecraft ×1