Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@phlandscape
Created August 16, 2012 12:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phlandscape/3369692 to your computer and use it in GitHub Desktop.
Save phlandscape/3369692 to your computer and use it in GitHub Desktop.
C++ solution for /r/dailyprogrammer Challenge #85 Intermediate
:::::::::::::::::::/
:::::::::::::::::::/+
:::::::::::::::::::/++
####################+++
####################+++
####################+++
####################+++
####################+++
####################+++
####################+++
####################++
####################+
####################
/*
http://www.reddit.com/r/dailyprogrammer/comments/xq2ao/832012_challenge_85_intermediate_3d_cuboid/
*/
/**
* #include File Doc
* main.cpp
iostream
*
*/
#include <iostream>
using namespace std;
void PrintCube(int length, int height, int width){
for(int i = width; i > 0; i--){
for(int kk = 0; kk < i; kk++){
cout << " ";
}
for(int jj = 0; jj < (length-1); jj++){
cout << ":";
}
cout << "/";
for(int mm = 0; mm < (width-i); mm++){
cout << "+";
}
cout << endl;
}
for(int i = height; i > 0; i--){
for(int kk = 0; kk < length; kk++){
cout << "#";
}
for(int jj = 0; jj < width; jj++){
cout << "+";
}
cout << endl;
}
for(int i = 1; i <= width; i++){
for(int kk = 0; kk < length; kk++){
cout << "#";
}
for(int mm = 0; mm < (width-i); mm++){
cout << "+";
}
cout << endl;
}
}
int main(){
PrintCube(20,10,3);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment