public class Main {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String matrik1[]={"a","b","c","d","e","f","g","h","i","j","k","l","m",
"n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9",};
String matrik3[]={"g","k","m","w","q","y","x","z","n","o","p","a","r",
"u","t","v","z","h","j","l","b","c","d","e","f","i",
"7","5","3","2","6","8","9","4","0","1","*"};
String input = JOptionPane.showInputDialog(null, "Masukkan sandi anda").toUpperCase();
char x[] = input.toCharArray();
for (int i = 0; i < x.length; i++) {
for (int j = 0; j < matrik3.length; j++) {
if(String.valueOf(x[i]).equalsIgnoreCase(matrik3[j])) {
System.out.print(matrik1[j]);
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
String matrik1[]={"a","b","c","d","e","f","g","h","i","j","k","l","m",
"n","o","p","q","r","s","t","u","v","w","x","y","z","0","1","2","3","4","5","6","7","8","9",};
String matrik3[]={"g","k","m","w","q","y","x","z","n","o","p","a","r",
"u","t","v","z","h","j","l","b","c","d","e","f","i",
"7","5","3","2","6","8","9","4","0","1","*"};
String input = JOptionPane.showInputDialog(null, "Masukkan sandi anda").toUpperCase();
char x[] = input.toCharArray();
for (int i = 0; i < x.length; i++) {
for (int j = 0; j < matrik3.length; j++) {
if(String.valueOf(x[i]).equalsIgnoreCase(matrik3[j])) {
System.out.print(matrik1[j]);
Perhitungan :
Matrik1
[] dieksekusi
1 kali
Matrik3
[] dieksekusi
1 kali
String
input dieksekusi
1 kali
Char
x [] dieksekusi
1 kali
i
= 0 dieksekusi
1 kali
i<x.length dieksekusi n kali
i<x.length dieksekusi n kali
i++ dieksekusi
n kali
j
= 0 dieksekusi
1 kali
j<matrik3.length dieksekusi
n kali
j++ dieksekusi
n kali
if dieksekusi
1 kali
matrik1[j] dieksekusi
1 kali
8 + 4n kali
Posted by 01.49 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar