/**
*
* @author COMPAQ
*/
public static void main(String[] args) {
String[]Q ={"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","",""
};
String[]W = {"10","20","30","40","50","60","70","80","90","00","11","21",
"31","41","51","61","71","81","91","01","12","22","32","42","52","62","72"
,"",""
};
String kode =JOptionPane.showInputDialog(null,"masukkan sandi anda");
char[] E = kode.toCharArray();
for (int i=0;i<E.length;i++){
for (int j=0;j<Q.length;j++){
if (String.valueOf(E[i]).equalsIgnoreCase(Q[j]))
System.out.println(W[j]);
}
}
System.out.println("");
}
}
String[]Q ={"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","",""
};
String[]W = {"10","20","30","40","50","60","70","80","90","00","11","21",
"31","41","51","61","71","81","91","01","12","22","32","42","52","62","72"
,"",""
};
String kode =JOptionPane.showInputDialog(null,"masukkan sandi anda");
char[] E = kode.toCharArray();
for (int i=0;i<E.length;i++){
for (int j=0;j<Q.length;j++){
if (String.valueOf(E[i]).equalsIgnoreCase(Q[j]))
System.out.println(W[j]);
}
}
System.out.println("");
}
}
//Perhitungan
String [] Q 1x
String [] W 1x
String kode 1x
char [] E nx
i = 0; 1x
i<E.length; nx
i++; nx
j=0; 1x
j<Q.length; n x n
j++; n x n
String.valueOf(E[i]).equalsIgnoreCase(Q[j]) nx
System.out.print(W[j]); n x n
System.out.print(“ ”); 1x
6 + 4n + 3n2 kali --> T (n) = O (n2)
Hamsyah / UNITOMO /2012420077
Posted by 07.30 and have
0
komentar
, Published at
Tidak ada komentar:
Posting Komentar