SHARE
TWEET

Untitled

a guest Feb 18th, 2020 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html>
  3.     <head>
  4.         <meta charset="utf-8">
  5.     </head>
  6.     <body>
  7.         <script>
  8.             //stek stavam elementi eden vrz drug, ima  funkcii :s.peek(dava element na vrvo); s.pop(vade element od vrvo); s.push(stava element na vrvo);
  9.             stack s;
  10.             niza = [1, 4, 8, '+', 3, '*', '-', 0];
  11.             for (i=0; niza[i]!=0; i++){
  12.                 if(proveri(niza[i])==true){
  13.                     s.push(niza[i]);
  14.                 }
  15.                 else if( tab[i]=='*'){
  16.                  var prva = s.pop;
  17.                  var vtora = s.pop;
  18.                  s.push(prva*vtora);
  19.  
  20.                 }
  21.              }
  22.              console.log(s.peek);          
  23.         </script>
  24.     </body>
  25. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top