Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- A=prompt("Задайте строку:");
- if(A!==""){
- dlina=A.length-1;
- str="";
- polovina=Math.round(dlina/2);
- Arr=A.split("");
- for(i in Arr){
- i=parseInt(i);
- if(i!==polovina){
- str+=Arr[i];
- }
- }
- alert("Новая строчка: "+str);
- }
- </script>
Advertisement
Add Comment
Please, Sign In to add comment