0
Can you help me correct my code? Using C (loops). 🙏🏻
In the song "Twelve days of Christmas", the person's true love gave her gifts everyday, following the pattern: in the first day he gave a partridge in a pear tree, in the second day he gave 2 turtle doves plus a partridge in a pear tree again, in the third day he gave 3 gifts plus all the preceding presents, and so on. Create an algorithm that will compute for the total gifts given by the true love to the person from the first day to the twelfth day of Christmas. https://code.sololearn.com/cF1jvpPBqTuX/?ref=app
4 odpowiedzi
+ 1
It turned out to be pretty easy. Please try to understand the code for yourself ;)
https://code.sololearn.com/c0M1iyMQ4Zw5/?ref=app
+ 2
https://code.sololearn.com/cAu4N5armZ08/?ref=app
0
I could make a version that shows the gifts each day, but I don’t quickly see a way to do that with a short program.
0
That'd be great. It'll be fine even if it's long.