Created
December 17, 2014 19:32
-
-
Save sicknarlo/98e28918d9122aefd5e9 to your computer and use it in GitHub Desktop.
[CodeEval] Lower Case
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Change all letters to lower case | |
#include<iostream> | |
#include<string> | |
#include<cstdlib> | |
using namespace std; | |
int main(){ | |
string str; | |
while (getline(cin, str)){ | |
for (int i = 0; i < str.length(); i++){ | |
int chrAsInt = str[i]; | |
if (chrAsInt >= 65 && chrAsInt <= 90){ | |
char hold = chrAsInt + 32; | |
str[i] = hold; | |
} | |
} | |
cout << str << endl; | |
} | |
system("pause"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment