Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Count Elements in an Iterator Range | Iterators with Algorithms
C++ STL Iterators
Seção 4. Capítulo 2
single

single

bookChallenge: Count Elements in an Iterator Range

Deslize para mostrar o menu

Tarefa

Swipe to start coding

Implement count_in_range to return the number of elements in a std::vector<int> iterator range.

  • Signature: int count_in_range(std::vector<int>::iterator first, std::vector<int>::iterator last).
  • The range is [first, last).
  • Use std::distance.
  • Do not use loops, indexing, or .size().
  • Return the element count.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 4. Capítulo 2
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

some-alt