Challenge: Vector Operations in Practice
Aufgabe
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.
Lösung
solution.cpp
War alles klar?
Danke für Ihr Feedback!
Abschnitt 2. Kapitel 2
single
Fragen Sie AI
Fragen Sie AI
Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen
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
Swipe um das Menü anzuzeigen
Aufgabe
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.
Lösung
solution.cpp
War alles klar?
Danke für Ihr Feedback!
Abschnitt 2. Kapitel 2
single