Advertisement
Guest User

Untitled

a guest
Oct 16th, 2019
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.69 KB | None | 0 0
  1. //let x = 2;
  2. // x--;//x=x-1
  3. // ++x;
  4. // x++;
  5. //let y = ++x +4;
  6. // console.log(x);
  7. // console.log(y);
  8. //console.log(2**10);
  9. //////////////////////////////
  10. // let x = 10;
  11. // if(x>15 && x<25){
  12. // console.log("Гулять")
  13. // }
  14. // else {
  15. // console.log("Сериал")
  16. // }
  17. //////////////////////////////
  18. // let x = 6;
  19. // if(x==5 || x==6){
  20. // console.log("Win")
  21. // }
  22. // else {
  23. // console.log("Loose")
  24. // }
  25. //////////////////////////////
  26. // let x = 10;
  27. // if(!(x<0)){
  28. // console.log("+")
  29. // }
  30. // else {
  31. // console.log("-")
  32. // }
  33. //////////////////////////////
  34. // let x = -10;
  35. // if(x>0)
  36. // console.log("+")
  37. // else if(x<0)
  38. // console.log("-")
  39. // else(x==0)
  40. // console.log("0")
  41. ///////////////////////////////////////////////
  42.  
  43. // let age = 10;
  44. // let result = (age>=14)?true:false;
  45. // // if(age>=14){
  46. // // result = true;
  47. // // }
  48. // // else{
  49. // // result = false;
  50. // // }
  51.  
  52. // console.log(result);
  53.  
  54. ///////////////////////////////////////////////
  55. // let x = 10;
  56. // let i =10;
  57. // while(i<10){
  58. // console.log("hello");
  59. // i++;
  60. // }
  61. // console.log(i);
  62.  
  63. // let x = 10;
  64. // let i =10;
  65. // do {
  66. // console.log("hello");
  67. // i++;
  68. // } while(i<10);
  69.  
  70. // let x = 10;
  71. // for(let i =0;i<10;i++){
  72. // console.log("hello");
  73.  
  74. // }
  75. // console.log(i);
  76.  
  77. ///////////////////////////////////////
  78. let sum = 0;
  79. let numbers = 0;
  80. while(true){
  81. x = Math.floor(Math.random()*102);
  82. // if(x>80){
  83. // break;
  84. // }
  85.  
  86. if(x>100){
  87. console.error("error")
  88. continue;
  89. }
  90. numbers++;
  91. sum = sum + x;
  92. if(numbers>1000){
  93. break;
  94. }
  95.  
  96. }
  97. console.log(numbers);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement