caesar-cipher

    0熱度

    3回答

    這裏有一個Java代碼凱撒的密碼 import java.util.*; public class Main { public static void main(String[] args) { Scanner stdin = new Scanner(System.in); int length = stdin.nextInt(); String text =

    -1熱度

    1回答

    在第一個for循環中,我試圖向char數組添加一個偏移量,但無法這樣做。 我也想從終端輸入,所以我寫了一個**到argv [2]的代碼,並使用atoi()將char從argv [1]轉換爲int。 int main(int argc, char *argv[]) { if(argc != 3) { printf("Enter an integer followed by a

    0熱度

    1回答

    我有這個代碼,它是一個基本的凱撒密碼,偏移量設置爲1,但我希望它可以讓用戶輸入偏移量。用戶應該能夠通過字母多少在由感動地說,但它不會工作,如果偏移=輸入 #Caesar cipher sentance = input('Enter sentance: ') alphabet = ('abcdefghijklmnopqrstuvwxyz') offset = 1 cipher = ''

    -2熱度

    3回答

    下面的代碼正常工作,但是一旦消息被加密,消息就會打印到不同的行上。例如,如果我輸入:ABC與1移位它加密,但打印回爲: b c d 而且我不明白爲什麼。我希望它打印爲: bcd 下面是代碼: print("Welcome to the Code-Breaking/Making Software") print("This program uses something called a

    1熱度

    1回答

    所以我需要在Smalltalk的愷撒密碼的代碼,並創建一個方法,並使用它,所以我可以做下面的測試就可以了 |aString| aString:=Caesar new encrypt: 'CAESAR'. Transcript show: aString. 我已經類製造。但我需要制定它的方法。 我發現這個,但我怎麼能做出這個方法,所以我可以在操場上面的所有代碼。 | i c strCiphe

    1熱度

    2回答

    就像標題所說的那樣,爲什麼我們在這段代碼中使用「print i [-1]」? def caesar_cipher (string, number) string.scan (/./) do |i| if ("a".."z").include? (i.downcase) # Identify letters only. number.times {i = i.next

    1熱度

    5回答

    def main(): cc = (input("Enter Message to Encrypt\n"))#user input shift = int(2) #shift length a=["a","b","c","d","e","f","g","h","i","j","k","l", "m","n","o","p","q","r","s","

    0熱度

    2回答

    在獲得該字符這是我的代碼: package ch3; import java.util.Scanner; public class caesarCypher { static String inp; public static void main(String[] args) { int input; int x = 0; Sca

    0熱度

    2回答

    Caesar Cypher - 基本加密。 例如,如果第二個命令行(argv [1])等於3,我會要求你幫忙理解變量k爲什麼會收到負值。 int main (int argc, string argv[]) { string text; int k = 0; do { printf("Type in a plain text:\n");

    -2熱度

    1回答

    Ceaser密碼不考慮加密中的數字。如何擴展它,以便用字母和數字替換每個字母,然後用XOR每個字符加上一個加密密鑰。這是我到目前爲止編寫的加密代碼...我可以知道我的錯在哪裏....輸出不準確。 string Encrypt (string s) { string cipher = s; int size = s.length(); for(int i = 0;