O_o
You're new at this alright. That's okay. A 3 dimensional char matrix is a weird beast, but I'm sure that's what you're going to need.
Code:
#include <stdio.h>
/* WRT [4][5][4]:
* [4], 1st dimension = # of numbers
* [5], 2nd dimension = # of lines in each number
* [4], 3rd dimension = # of characters in each line INCLUDING NULL TERMINATOR!!
*/
const char Numbers[4][5][4] = {
{"ooo",
"o o",
"o o",
"o o",
"ooo"}, // <- pay attention to where these commas are
// notice you can break the definition up onto lines
// for simplicity, here's "1" without them
{" o ", " o ", " o ", " o ", " o "},
{"ooo",
" o",
"ooo",
"o ",
"ooo"},
{"ooo",
" o",
"ooo",
" o",
"ooo"}
};
int main(void) {
int i;
for (i = 0; i < 5; i++)
printf("%s %s %s\n", Numbers[1][i], Numbers[2][i], Numbers[3][i]);
return 0;
}
So the more aesthetically pleasing version:
Code:
root~/C»./a.out
o ooo ooo
o o o
o ooo ooo
o o o
o ooo ooo
The tricky part is going to be using that dynamically based on the input. I think you will need five for(i = 0; i < number of digits; i++) loops, one for each line.
But I'm not going to write the whole thing for you -- you stand to get in trouble, remember. It is homework, you need to sweat and think, and next time: post some code!