anisaanisa
پنج شنبه 27 تیر 1387, 17:57 عصر
خانومها و آقایون دانشمند هم اکنون به یاری سبزتان نیازمندیم.اگه سر در آوردین به یه کم راهنمایی
نیاز است
ممنون
import javax.swing.JOptionPane;
class coder_decoder {
public static void main(String[] args) {
char[] arry;
char text4,text2,text5;
byte text3;
String text=JOptionPane.showInputDialog(null,"Enter a Text");
arry=text.toCharArray();
for(int i=0;i<arry.length;i++)
{
text2 = text.charAt(i); //har done az horof ro dar text2 mirize
text3 = (byte) text2; //harfe dakhele txt2 ro code ascii sho dar miare
text3 += 5; // code mikone horofo
text4 = (char) text3; //be character tabdil mikone
System.out.print(text4);
//-------------------now i want to decode-----------------------\\
//text3-=5;
}
//----System.out.print("\noreginal text is: "+text); because i cant find any solution
}
}
نیاز است
ممنون
import javax.swing.JOptionPane;
class coder_decoder {
public static void main(String[] args) {
char[] arry;
char text4,text2,text5;
byte text3;
String text=JOptionPane.showInputDialog(null,"Enter a Text");
arry=text.toCharArray();
for(int i=0;i<arry.length;i++)
{
text2 = text.charAt(i); //har done az horof ro dar text2 mirize
text3 = (byte) text2; //harfe dakhele txt2 ro code ascii sho dar miare
text3 += 5; // code mikone horofo
text4 = (char) text3; //be character tabdil mikone
System.out.print(text4);
//-------------------now i want to decode-----------------------\\
//text3-=5;
}
//----System.out.print("\noreginal text is: "+text); because i cant find any solution
}
}