Skip to content

Instantly share code, notes, and snippets.

@fpdjsns
Created January 3, 2019 11:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fpdjsns/53707ccb4e14ef90887175aeae2af24c to your computer and use it in GitHub Desktop.
Save fpdjsns/53707ccb4e14ef90887175aeae2af24c to your computer and use it in GitHub Desktop.
#include<iostream>
#include<string>
using namespace std;
char toUpper(char c) {
return ('a' <= c && c <= 'z') ? c - 'a' + 'A' : c;
}
int main() {
string s;
cin >> s;
for (int i = 0; i < s.size(); i++) {
s[i] = toUpper(s[i]);
}
cout << s;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment