Own One Score with make_unique
mediumQuestion 703Read one integer score from standard input. Hand it to a unique_ptr<int> built with make_unique, print the value through the pointer, then add 10 to the value through the pointer and print it again. The number itself must live on the heap.
For the input 42 the program prints exactly the output shown in Expected Output.
Print only the value the pointer points at, never the pointer itself. Do not write delete and do not use a raw new. Include <memory>.
Expected output
Score: 42 Bonus: 52
= newline. The output ends with a newline, so print one after the last line.
Hints4 available
Sign in to use hintsTopics
Pointers
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your output
Run your code to see the output here...
Test cases
Run your code to see test case results.