Sep 15, 2012 at 6:06pm UTC
i got the block letters down, which is SZ, however when i ran the program instead of the letters being together (one after the other) the Z is instead in the next space down like this:
S
Z
instead of this: SZ
now iam new to this website, and C++ in general, iam going to copy and paste my code into the box, but is there a way to write code on here so that its displayed for the other users to see?
now back to the problem.........i tried right and left justify to no avail. can someone point me in the right direction? thanks and look foward to learning more......heres the code:
#include<iostream>
#include<iomanip>//for set width
using namespace std;
int main()
{
//The letter S of Steven
const int ARRAY_SIZES = 2;
char cstrings[ARRAY_SIZES] = "S";
//long part top of s
cout << setw(2) << cstrings << cstrings << cstrings << cstrings << cstrings << cstrings << cstrings<< cstrings << cstrings << cstrings << cstrings << cstrings << cstrings <<endl;
cout << setw(2) << cstrings << cstrings << cstrings << cstrings << cstrings << cstrings << cstrings<< cstrings << cstrings << cstrings << cstrings << cstrings << cstrings << endl;
//middle of s
cout << setw(2) << cstrings << cstrings << cstrings <<endl;
cout << setw(4) << cstrings << cstrings << cstrings <<endl;
cout << setw(6) << cstrings << cstrings << cstrings <<endl;
cout << setw(8) << cstrings << cstrings << cstrings <<endl;
cout << setw(10) << cstrings << cstrings << cstrings <<endl;
cout << setw(11) << cstrings << cstrings << cstrings <<endl;
cout << setw(12) << cstrings << cstrings << cstrings <<endl;
//long part bottom of s
cout << setw(2) << cstrings << cstrings << cstrings << cstrings << cstrings << cstrings << cstrings<< cstrings << cstrings << cstrings << cstrings << cstrings << cstrings <<endl;
cout << setw(2) << cstrings << cstrings << cstrings << cstrings << cstrings << cstrings << cstrings<< cstrings << cstrings << cstrings << cstrings << cstrings << cstrings << "\t";
//The Letter Z of Zuniga
const int ARRAY_SIZEZ = 2;
char cstringz[ARRAY_SIZEZ] = "Z";
//top long part of z
cout << setw(10) << cstringz << cstringz << cstringz << cstringz << cstringz << cstringz<< cstringz << cstringz << cstringz<< cstringz << cstringz<< cstringz << cstringz << cstringz<< cstringz << endl;
cout << setw(26) << cstringz << cstringz << cstringz << cstringz << cstringz << cstringz<< cstringz << cstringz << cstringz<< cstringz << cstringz<< cstringz << cstringz << cstringz<< cstringz << endl;
//middle part of z
cout << setw(36) << cstringz << cstringz << cstringz << endl;
cout << setw(34) << cstringz << cstringz << cstringz << endl;
cout << setw(32) << cstringz << cstringz << cstringz << endl;
cout << setw(30) << cstringz << cstringz << cstringz << endl;
cout << setw(28) << cstringz << cstringz << cstringz << endl;
//bottom long part of z
cout << setw(26) << cstringz << cstringz << cstringz << cstringz << cstringz << cstringz<< cstringz << cstringz << cstringz<< cstringz << cstringz<< cstringz << cstringz << cstringz<< cstringz << endl;
cout << setw(26) << cstringz << cstringz << cstringz << cstringz << cstringz << cstringz<< cstringz << cstringz << cstringz<< cstringz << cstringz<< cstringz << cstringz << cstringz<< cstringz << endl;
return 0;
}