#include <stdio.h>
#include <string.h>
void reverse(char str[]) {
char tmp;
for (int i = len / 2; i >= 0; i--) {
tmp = str[i];
str[i] = str[len - i - 1];
str[len - i - 1] = tmp;
}
}
int main(void) {
char str[] = "123";
reverse(str);
}
//https://pt.stackoverflow.com/q/37031/101
I2luY2x1ZGUgPHN0ZGlvLmg+CiNpbmNsdWRlIDxzdHJpbmcuaD4KCnZvaWQgcmV2ZXJzZShjaGFyIHN0cltdKSB7CiAgICBpbnQgbGVuID0gc3RybGVuKHN0cikgOwogICAgY2hhciB0bXA7CiAgICBmb3IgKGludCBpID0gbGVuIC8gMjsgaSA+PSAwOyBpLS0pIHsKICAgICAgICB0bXAgPSBzdHJbaV07CiAgICAgICAgc3RyW2ldID0gc3RyW2xlbiAtIGkgLSAxXTsKICAgICAgICBzdHJbbGVuIC0gaSAtIDFdID0gdG1wOwogICAgfQp9CgppbnQgbWFpbih2b2lkKSB7CgljaGFyIHN0cltdID0gIjEyMyI7CglyZXZlcnNlKHN0cik7CglwcmludGYoIiVzIiwgc3RyKTsKfQoKLy9odHRwczovL3B0LnN0YWNrb3ZlcmZsb3cuY29tL3EvMzcwMzEvMTAx