import java.io.*;
class carikarakter{
public static void main(String[] args) throws IOException{
InputStreamReader isr = new InputStreamReader(System.in);
BufferedReader br = new BufferedReader(isr);
String a,d;
try{
System.out.print("Masukkan Kalimat : ");
a = br.readLine();
System.out.print("Masukkan karakter yang dicari : ");
d = br.readLine();
System.out.print("Karakter tersebut pada posisi : " +a.indexOf(d));}
catch(NumberFormatException nfe){
System.exit(0); }
}
}
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar