You can figure out your first problem just by looking at your results. You're not printing the last 1 of each row. Why? Well, you're stopping too early in your loop that prints out the row's numbers.
For your second problem, if you temporarily added a few cout statements that showed the numbers you're adding, you'd see your problem very quickly.
You might not have to go through this effort -- I'm sure some shmuck will come along to tell you exactly what's wrong with your code.
Reputation Points: 1133
Solved Threads: 171
Super Senior Demiposter
Offline 2,478 posts
since Jun 2005