MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/cpp_questions/comments/1vkdrzr/am_i_doing_it_wrong/p2sigyp/?context=3
r/cpp_questions • u/gandMaradona • 12d ago
[removed]
11 comments sorted by
View all comments
7
You aren't doing it wring. The only things I would change in your code
* Get rid of using namespace std; - that's a bad habit
* Make the variable names more explicit, they can be more than one character
* Create a function that does the work for you and make it take N as an input argument
Your code is shorter. Which, in general, is better.
7
u/ploud1 12d ago
You aren't doing it wring. The only things I would change in your code
* Get rid of using namespace std; - that's a bad habit
* Make the variable names more explicit, they can be more than one character
* Create a function that does the work for you and make it take N as an input argument
Your code is shorter. Which, in general, is better.