Here's a simple C++ problem that deals with basic input and output processing. The solution is straight forward, using while loops, if statements and decrements.
Problem:
Write a program that reads in the size of the side of a square and then prints a hollow square of that size out of asterisks and blanks. Your program should work for squares of all side sizes between 1 and 20. For example, if your program reads a size of 5, it should print
*****
* *
* *
* *
*****
The solution is in my Github page.
Here's a sample test run
Saturday, February 16, 2013
Hello World!
For my first post, I would like to introduce myself. I'm a Computer Engineering student from the Polytechnic University of the Philippines. My interests are programming (C/C++, Java, Python, C#), open source hardware (Arduino), and Console/PC gaming (NBA 2K13, Assassins Creed). I also love mathematics (Calculus, Digital Signal Processing) but I haven't practiced my problem solving skills for quite some time because I'm always busy either programming or playing games. I created this blog to cater all of my programming/ electronics projects and to serve also as a reference for others' projects. It's my own little way of contributing to the open source community. :)
Subscribe to:
Posts (Atom)