Created
May 10, 2020 18:32
-
-
Save kryvoboker/5bf9c9e3c7b00a8edf81b36cd479ef3a to your computer and use it in GitHub Desktop.
HomeWork5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.Arrays; | |
import java.util.Scanner; | |
/** | |
* | |
* @author kamaz | |
*/ | |
public class Main { | |
public static void main(String [] args) { | |
Scanner sc = new Scanner(System.in); | |
String a = sc.nextLine(); | |
char [] letterArray = a.toCharArray(); | |
int n = 0; | |
for (int i = 0; i < letterArray.length; i++) { | |
if (letterArray[i] == 'b') { | |
n += 1; | |
} | |
} | |
System.out.println(Arrays.toString(letterArray)); | |
System.out.println(n); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment