小编AJH*_*ker的帖子

SCP说文件已下载,但文件未出现

我正在使用ssh在远程服务器上工作,但是当我尝试使用scp以这种格式下载文件时:

scp name@website.com:somefile.zip ~/Desktop
Run Code Online (Sandbox Code Playgroud)

它要求我输入密码,并显示以下内容:

somefile.zip                                      100% 6491     6.3KB/s   00:00   
Run Code Online (Sandbox Code Playgroud)

但是,此文件永远不会出现在我的桌面上。任何帮助

macos ssh shell terminal

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

Java指数误差为2 ^ 31次幂

我正在编写一个java程序来输出2的指数幂(顺便说一下,我不能使用Math.pow()),但是在2 ^ 31和2 ^ 32我得到了别的东西.另外,我不打算接受负整数.

我的代码:

class PrintPowersOf2 {
    public static void main (String[] args) {
        printPowersOf2(10);
        printPowersOf2(5);
        printPowersOf2(2);
        printPowersOf2(-5);
        printPowersOf2(30);
        printPowersOf2(32);
    }

    public static void printPowersOf2 (int x) {
        for(int i=0;i<x+1;i++) {
            int y = exponent (i);
            System.out.print(y);
            if(!(i == x)) {
                System.out.print(" ");
            }
        }
        System.out.println();
    }

    static int exponent(int power) {
        int output = 1; 
        for (int z=0; z<power; z++) 
        output *= 2; 
        return output; 
    }
}
Run Code Online (Sandbox Code Playgroud)

我得到的输出是:

1 2 4 8 16 32 64 …
Run Code Online (Sandbox Code Playgroud)

java

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

标签 统计

java ×1

macos ×1

shell ×1

ssh ×1

terminal ×1