C++,Recursion,Three Number combination if their sum less than 10.
4 03 Aug 2016 22:36 by u/Jeena6
Print the number in this format using recursion like {0,1,2} {0,1,3} {0,1,4} {0,2,3} {0,2,4} {0,3,4} {1,2,3} {1,2,4} {1,3,4} {2,3,4}
4 03 Aug 2016 22:36 by u/Jeena6
Print the number in this format using recursion like {0,1,2} {0,1,3} {0,1,4} {0,2,3} {0,2,4} {0,3,4} {1,2,3} {1,2,4} {1,3,4} {2,3,4}
9 comments
2 u/2-5318008 03 Aug 2016 23:19
Haven't done c++ in a while, so this could be, ya know, not the correct syntax, but you'll figure it out.
2 u/spookybm 03 Aug 2016 23:29
You might have it confused with a different language. "public" is used only on classes, this is a function type.
void main() should be sufficient.
Your cout syntax should be
1 u/2-5318008 03 Aug 2016 23:31
Yes I must, too much damn java at work.
0 u/J_Darnley 04 Aug 2016 10:28
Why do people even like C++. "cout left shifted by open brace"?
0 u/spookybm 04 Aug 2016 17:15
Those are only left shifts if you use them as logical operators. But in this case it is for namespace
1 u/RevanProdigalKnight 04 Aug 2016 19:57
In the case of complicated command-line printing, I still prefer to use C's
printf. It's less confusing and more readable, in my opinion.2 u/tame 03 Aug 2016 23:29
Is there a rule in this sub against doing peoples' homework for them?
1 u/2-5318008 04 Aug 2016 04:20
I can't see one. Sometimes lower level problems help mix it up in contrast to the technically in depth articles which apply to ~15% of programmers and 10% of programmers understand (looking at you RUST). A lower level problem, or particularly a fun mid level problem can help bring more programmers together.
Though yes, it is annoying seeing other people's homework, they don't benefit from having others do their homework, and sometimes I enjoy seeing unique problems, I hate see the giant problem lists that float around. In the mean time, their incompetence (from not doing their homework) makes the rest of us look better on the market, so it's not helping them, and it's not hurting us.
1 u/tame 04 Aug 2016 04:30
Nice sum-up of the issues, I see it pretty much the same way. On the one hand, giving someone a pre-made answer on a plate does them a disservice in terms of the value they get from their education, and it can be like feeding seagulls, where suddenly you're getting spammed with every first-year assignment question around.
On the other hand, sometimes they're fun little exercises to do just to inject some variety into your day.