Challenge: Vector Operations in Practice
Tarefa
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.
Solução
solution.cpp
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 2. Capítulo 2
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo
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
Deslize para mostrar o menu
Tarefa
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.
Solução
solution.cpp
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 2. Capítulo 2
single