Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cctype>
- using namespace std;
- int main(int argc, char* argv[])
- {
- char buffer[100];
- // Get thhe string from the user.
- cout << "Please enter a string: ";
- cin >> buffer;
- // Iterate over the array.
- for(int c = 0; c < 100; ++c) {
- // Change the character to uppercase.
- buffer[c] = toupper(buffer[c]);
- // Switch certain letters with numbers. l33t!
- switch(buffer[c]) {
- case 'A':
- buffer[c] = '4';
- break;
- case 'O':
- buffer[c] = '0';
- break;
- case 'I':
- buffer[c] = '1';
- break;
- }
- }
- // Print it out!
- cout << "Cool, here is your string: " << buffer << "!!!!!" << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement