Skip to content

Instantly share code, notes, and snippets.

@d351d3r
Created October 11, 2020 06:01
Show Gist options
  • Select an option

  • Save d351d3r/028f5fee6d059b8cdf5d7655482d0317 to your computer and use it in GitHub Desktop.

Select an option

Save d351d3r/028f5fee6d059b8cdf5d7655482d0317 to your computer and use it in GitHub Desktop.
#include <algorithm>
#include <iostream>
#include <locale>
#include <string>
#include <cstring>
int strlen(char *s);
using namespace std;
int main() {
const char *s = "Just ";
char v = '\0';
int l = strlen(s);
for (int i = 0; i < 1 << l; i++) {
for (int j = 0; j < l; j++) {
if (j != 4) {
if (i & (1 << j)) v = toupper(s[j]); else v = tolower(s[j]);
cout << v;
}
}
cout << endl;
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment