Skip to content

Instantly share code, notes, and snippets.

@fpdjsns
Created January 3, 2019 11:09
Show Gist options
  • 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