Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 暴力不';如果我不工作,我可以';我找不到密钥_Java_Loops_Brute Force - Fatal编程技术网

Java 暴力不';如果我不工作,我可以';我找不到密钥

Java 暴力不';如果我不工作,我可以';我找不到密钥,java,loops,brute-force,Java,Loops,Brute Force,当我运行程序时,没有输出,只是运行了一段时间,什么也不做,我试着输入“!!!!!!!”这是字符中的ASCII 33。这是我的第四次或第五次代码迭代,我仍然无法让它工作 这是我的节目 public class BruteForceTrue { public static void main(String[] args) { int z = 0;//Variable Declarations int i = 0; int u = 0;

当我运行程序时,没有输出,只是运行了一段时间,什么也不做,我试着输入“!!!!!!!”这是字符中的ASCII 33。这是我的第四次或第五次代码迭代,我仍然无法让它工作

这是我的节目

public class BruteForceTrue {
    public static void main(String[] args) {

        int z = 0;//Variable Declarations
        int i = 0;
        int u = 0;
        int g = 0;
        int d = 0;
        int t = 0;
        int w = 0;
        char rechar1 = 0;
        char rechar2 = 0;
        char rechar3 = 0;
        char rechar4 = 0;
        char rechar5 = 0;
        char rechar6 = 0;
        String passT;
        String passF = " " ;
        StringBuilder sb = new StringBuilder();

        Scanner scanvar = new Scanner(System.in);
        System.out.println("Challenge me to crack your pasword:");//Password Input
        passT= scanvar.next();
        for(i=32;i<=127;i++){//For loop 1
            rechar1 = ((char)i);
            sb.setLength(0);//setting the list to blank
            sb.append(rechar1);// setting the first character in the password
            for (i=32;t<=127;t++){//For loop 2
                rechar2 = ((char)t);
                sb.append(rechar2);
                for(d=32;d<=127;d++){//For loop 3
                    rechar3 = ((char)d);
                    sb.append(rechar3);
                    for(g=32;g<=127;g++){//For loop 4
                        rechar4 = ((char)g);
                        sb.append(rechar4);
                        for(w=32;w<=127;w++){//For loop
                            rechar5 = ((char)w);
                            sb.append(rechar5);
                            for(u=32;u<=127;u++){//For loop
                                rechar6 = ((char)u);
                                sb.append(rechar6);
                                String ans = sb.toString();//turning the list into a string
                                if (ans.equals(passT)) {//asking if the guess is the same as the passcode
                                System.out.println("the password is" + ans);
                                    break;

                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
公共类BruteForceTrue{
公共静态void main(字符串[]args){
int z=0;//变量声明
int i=0;
int u=0;
int g=0;
int d=0;
int t=0;
int w=0;
char rechar1=0;
char rechar2=0;
char rechar3=0;
char rechar4=0;
char rechar5=0;
char rechar6=0;
字符串密码;
字符串passF=“”;
StringBuilder sb=新的StringBuilder();
Scanner scanvar=新扫描仪(System.in);
System.out.println(“挑战我破解你的密码:”;//密码输入
passT=scanvar.next();
for(i=32;i你的第二个for循环

for (i=32;t<=127;t++){//For loop 2
for(i=32;t您的第二个for循环

for (i=32;t<=127;t++){//For loop 2

for(i=32;t可能您的代码太慢了。请在代码中添加更多输出以获得想法。可能您的代码太慢了。请在代码中添加更多输出以获得想法。