次の繰り返されない文字を返すためのプログラムを作成する必要があります..
ex私は...を与え、それは出力を...tweet
として返す必要がありますw
public class str_next {
public static void main(String args[]) throws Exception {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Enter the string");
String s = br.readLine();
revString(s);
}
static char revString(String str) {
int i = 0;
int j;
int n = str.length();
for (i = 0; i < n; i++) {
for (j = i + 1; j < n; j++) {
char c = str.charAt(i);
char d = str.charAt(j);
if (c != d) {
System.out.print(d);
}
}
}
}
}
.. return ステートメントがありません.. というエラーが発生します。
誰か教えてください..どうすればそのような問題を解決できますか..どこが間違っていますか..?