Skip to content

Instantly share code, notes, and snippets.

@sicknarlo
Created December 17, 2014 19:32
Show Gist options
  • Save sicknarlo/98e28918d9122aefd5e9 to your computer and use it in GitHub Desktop.
Save sicknarlo/98e28918d9122aefd5e9 to your computer and use it in GitHub Desktop.
[CodeEval] Lower Case
//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