Challenge: Vector Operations in Practice
Tehtävä
Swipe to start coding
Implement two functions:
- Define a function named
createSequencethat takes an integer argumentnand returns astd::vector<int>containing the numbers from1ton(inclusive), in order; - Define a function named
sumVectorthat takes aconst std::vector<int>&as an argument and returns the sum of its elements as an integer.
Ratkaisu
solution.cpp
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 2. Luku 2
single
Kysy tekoälyä
Kysy tekoälyä
Kysy mitä tahansa tai kokeile jotakin ehdotetuista kysymyksistä aloittaaksesi keskustelumme
Suggested prompts:
Can you explain this in simpler terms?
Can you give me an example?
What are the main benefits or drawbacks?
Awesome!
Completion rate improved to 6.67
Challenge: Vector Operations in Practice
Pyyhkäise näyttääksesi valikon
Tehtävä
Swipe to start coding
Implement two functions:
- Define a function named
createSequencethat takes an integer argumentnand returns astd::vector<int>containing the numbers from1ton(inclusive), in order; - Define a function named
sumVectorthat takes aconst std::vector<int>&as an argument and returns the sum of its elements as an integer.
Ratkaisu
solution.cpp
Oliko kaikki selvää?
Kiitos palautteestasi!
Osio 2. Luku 2
single