0
public class Programming {
public static void main(String[] args) {
// Scanner scan = new Scanner(System.in);
int l = 0;
StringBuilder password = new StringBuilder();
l = password.length();
for (l = 1; l < 100; l++) {
if (l > 0 || l < 100) {
System.out.println("Your password has the correct length");
}
}
if (l < 0 || l > 100) {
System.out.println("Your password does NOT have the correct length");
}
for (int i = 0; i < 127; i++) {
}
}
}
我想知道如何運行一個循環來找出由PasswordGenerator類生成的第一個字符。文檔here但每個字符只是一個0-127之間的標準ASCII碼,之後我必須附加每個字符使其成爲一個字符串。密碼的長度在0到100之間(以上)。確定密碼 - 循環找到字符 - 附加StringBuilder
不知道是什麼隨機(;)在我的節目中是幹什麼的,只注意到它... – 2012-04-22 21:07:51
你爲什麼通過密碼長度檢查100次循環? – JohnFx 2012-04-22 21:25:14
另外,我在代碼中看不到密碼生成器。你只是在每次首先將密碼設置爲任何東西時測試一個空字符串。 – JohnFx 2012-04-22 21:26:08