Ad
Code
Diff
  • const cinema_auditorium = (spisok2D,ryad)=> {
      var soldTickets = 0;
      for (var i = 0; i < spisok2D[ryad].length; i++){
        if (spisok2D[ryad][i] !== 0){
          soldTickets++
        }
      }
      return soldTickets;
    }
    • const cinema_auditorium = (spisok2D,ryad)=> {
    • console.log(spisok2D,ryad)
    • return 3
    • var soldTickets = 0;
    • for (var i = 0; i < spisok2D[ryad].length; i++){
    • if (spisok2D[ryad][i] !== 0){
    • soldTickets++
    • }
    • }
    • return soldTickets;
    • }
Code
Diff
  • function sumNechet(a, b) {
      let sum = 0;
      
      function нечетное(x){
        return x % 2 !== 0;
      }
      for (let i = a; i <= b; i++){
        if(нечетное(i)){
          sum += i;
        }
      }
      return sum
                
    }
    
    • function sumNechet(a, b) {
    • let sum = 0;
    • function нечетное(x){
    • return x % 2 !== 0;
    • }
    • for (let i = a; i <= b; i++){
    • if(нечетное(i)){
    • sum += i;
    • }
    • }
    • return sum
    • }
    • function нечетное(число) {
    • }
Code
Diff
  • const tab = (f, a, b, h) => {
      let sum = 0;
      for (let x = a; x <= b; x += h){
        sum += f(x);
      }
      return sum;
     
    }
    • const tab = (f, a, b, h) => {
    • let sum = 0;
    • for (let x = a; x <= b; x += h){
    • sum += f(x);
    • }
    • return sum;
    • }