Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- A=prompt("Задайте строку:");
- if(A!==""){
- C=prompt("Задайте букву:");
- if(C!=="" && C.length==1){
- B=A.split("");
- num=0;
- for(i in B){
- if(B[i]==C){num++;}
- }
- if(num==0){
- alert("Такой буквы вообще нет");
- }else{
- alert("Буква \""+C+"\" повторяется - "+num+" раз.");
- }
- }
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment