Critical Thinking and Problem Solving

Hello, I just got finished going over a solution in class that I couldn't get to for the life of me.

At the end of the class I asked my teacher what I could do so that I could train my brain to come up with the solution.

To be exact, the problem posed was that I basically had to right code to create a hollow box and a solid box, given any set of dimensions.

I immediately knew how to write the code for the solid one, but could not figure out how I was supposed to right code such that we get spaces in the not-first, not-last, and all the inbetween rows/columns.

Long story short, he advised that I do some problem solving puzzles. Now I've been googling for this stuff for the past 10 minutes and I'm just being directed to silly SAT math problems.

I was wondering if you guys knew of any ways to help sharpen critical thinking and problem solving skills that are vital to writing great source code.
Try solving this one: write a program using loops to print this out:
@      |
 @     |
  @    |
   @   |
    @  |
     @ |
      @|
project ueler http://projecteuler.net/

this guy is full of them, i got better at knowing how to use what I knew with this guy
I think you would want a basic understanding of nested loops and for loops before you tried anything from project euler ;)
Ok, I'll take a crack at that. Thank you both for your responses!
When I find a solution to that I will post it!
Last edited on
How far did you get/are you in project Euler devonrevenge?
I wouldn't recommend Project Euler to C++ beginners.
A few problems are relatively easy to solve, and a lot difficult especially in C++.

A number of problems can be solved elegantly by using a BigInteger library (which C++ has yet to provide as standard). This will lead you to installing GNU MP or, God forbid, writing such a library yourself.

Then, most of the problems are reliant of a solid math background, if they are to be solved elegantly, and this has little to do with how well you know C++. Worse, they give you no hints or solution, so you need to learn the math elsewhere.
Topic archived. No new replies allowed.