Deploy su server Java
All checks were successful
Deploy / trigger (push) Successful in 19s

This commit is contained in:
2026-03-27 22:08:12 +01:00
parent 56214f1b57
commit 19d360b4d6
13 changed files with 5 additions and 4 deletions

View File

@@ -0,0 +1,18 @@
package com.crypto;
import java.util.Scanner;
public class Caesar {
public static void encode(Scanner sc){
String alphabet = "abcdefghijklmnopqrstuvwxyz";
System.out.println("Digita il testo in chiaro da cifrare:");
String base = sc.nextLine();
System.out.println("Digita il valore della chiave:");
int key = sc.nextInt();
char encoded[] = base.toCharArray();
for(int i = 0; i < base.length(); i++){
encoded[i] = alphabet.charAt(alphabet.indexOf(encoded[i]) + key % 26);
}
System.out.println(encoded);
}
}