All pastes #154092 Raw Edit

Smitty

public cpp v1 · immutable
#154092 ·published 2006-08-30 03:57 UTC
rendered paste body
#include <iostream>#include <string>using namespace std;// Function Declarationsstring converter(string);string lowercase(string);int main (int argc, char * const argv[]) {	string input;	string output;		//if (argc == 1) {	//	cout << "leet: [file or input] file" << endl;	//	return 1;	//}		/*	if (argv[1] == "file")	// File and vector code(file output also?)	cout << "The File code is not completed yet" << endl;		else if (argv[1] == "input")		// Input handling code		cout << "Rember this is still in beta :)" << endl;		else {		cout << "leet: unknown option" << endl;		return 0;	}	*/		cout << "Welcome to BJ's l33t converter"		 << endl		 <<  "Enter something to be converted to l33t: ";	getline(cin, input);	output=converter(input);	cout << output << endl;		return 0;}  string converter(string foo) {	int s=foo.size();	foo=lowercase(foo);	for (int i=0; i < s; i++)		if (foo[i] == 'a' )			foo[i] = '4';		else if (foo[i] == 'b')			foo[i] = '8';		else if (foo[i] == 'e')			foo[i] = '3';		else if (foo[i] == 'i')			foo[i] = '1';		else if (foo[i] == 'o')			foo[i] = '0';		else if (foo[i] == 's')			foo[i] = '5';		else if (foo[i] == 't')			foo[i] = '7';					return foo;}string lowercase(string foo) {	int s=foo.size();	for (int i=0; i < s; i++)		foo[i]=tolower(foo[i]);		return foo;}