Skip to content

Instantly share code, notes, and snippets.

@yukixz
Created March 20, 2017 15:41
Show Gist options
  • Save yukixz/a125681dae97f65eac64de8468d767e1 to your computer and use it in GitHub Desktop.
Save yukixz/a125681dae97f65eac64de8468d767e1 to your computer and use it in GitHub Desktop.
#include<stdio.h>
#include<string.h>
int main(int argc, char **argv) {
// UTF-8 is 3 byte long.
int W = 3;
// Input
char str[256];
scanf("%s", str);
int len = strlen(str);
// Output
for (int i = len - W; i >= 0; i -= W) {
for (int j = 0; j < W; j++) {
printf("%c", str[i+j]);
}
}
printf("\n");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment