Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Oppiskele Challenge: Count Elements in an Iterator Range | Iterators with Algorithms
C++ STL Iterators
Osio 4. Luku 2
single

single

bookChallenge: Count Elements in an Iterator Range

Pyyhkäise näyttääksesi valikon

Tehtävä

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.

Ratkaisu

Switch to desktopVaihda työpöytään todellista harjoitusta vartenJatka siitä, missä olet käyttämällä jotakin alla olevista vaihtoehdoista
Oliko kaikki selvää?

Miten voimme parantaa sitä?

Kiitos palautteestasi!

Osio 4. Luku 2
single

single

Kysy tekoälyä

expand

Kysy tekoälyä

ChatGPT

Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme

some-alt