Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- StringBuilder Zzz = new StringBuilder();
- Scanner in = new Scanner(System.in);
- String Stroka= in.nextLine();
- char b = in.next().charAt(0);
- boolean bl = false;
- for(int i =0;i<Stroka.length();i++) {
- if(Stroka.charAt(i)==b){
- System.out.println(i);
- bl = true;
- break;
- }
- }
- if (!bl) {
- System.out.println(-1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment